1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

fixed login dialog

This commit is contained in:
muerwre 2019-08-02 20:49:08 +07:00
parent 840af25df4
commit 6587f65e9b
6 changed files with 16 additions and 14 deletions

View file

@ -26,7 +26,7 @@ const ExampleDialog: FC<IProps> = ({ onRequestClose }) => {
useCloseOnEscape(onRequestClose); useCloseOnEscape(onRequestClose);
return ( return (
<ScrollDialog buttons={buttons} width={720}> <ScrollDialog buttons={buttons} width={860}>
<div className={styles.uploads}> <div className={styles.uploads}>
<div className={styles.cell} /> <div className={styles.cell} />
<div className={styles.cell} /> <div className={styles.cell} />

View file

@ -4,7 +4,7 @@ import { IDialogProps } from '~/redux/modal/constants';
import { useCloseOnEscape } from '~/utils/hooks'; import { useCloseOnEscape } from '~/utils/hooks';
import { Group } from '~/components/containers/Group'; import { Group } from '~/components/containers/Group';
import { InputText } from '~/components/input/InputText'; import { InputText } from '~/components/input/InputText';
import { Button } from '../../../components/input/Button/index'; import { Button } from '~/components/input/Button';
import { Padder } from '~/components/containers/Padder'; import { Padder } from '~/components/containers/Padder';
import * as styles from './styles.scss'; import * as styles from './styles.scss';
type IProps = IDialogProps & {}; type IProps = IDialogProps & {};
@ -13,8 +13,6 @@ const LoginDialog: FC<IProps> = ({ onRequestClose }) => {
const [username, setUserName] = useState(''); const [username, setUserName] = useState('');
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
const title = <div>title</div>;
const buttons = ( const buttons = (
<Padder> <Padder>
<Group horizontal> <Group horizontal>
@ -26,7 +24,7 @@ const LoginDialog: FC<IProps> = ({ onRequestClose }) => {
useCloseOnEscape(onRequestClose); useCloseOnEscape(onRequestClose);
return ( return (
<ScrollDialog buttons={buttons} width={300}> <ScrollDialog buttons={buttons} width={260}>
<Padder> <Padder>
<div className={styles.wrap}> <div className={styles.wrap}>
<Group> <Group>

View file

@ -2,7 +2,6 @@
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: center; justify-content: center;
min-height: 400px; padding: 20px 20px 60px 20px;
padding: 20px;
margin: auto; margin: auto;
} }

View file

@ -28,11 +28,11 @@ const ScrollDialog: FC<IProps> = ({
onOverlayClick, onOverlayClick,
onRefCapture onRefCapture
}) => { }) => {
const [height, setHeight] = useState(window.innerHeight - 240); const [height, setHeight] = useState(window.innerHeight - 120);
const [show_top_sticky, setShowTopSticky] = useState(false); const [show_top_sticky, setShowTopSticky] = useState(false);
const [ref, setRef] = useState(null); const [ref, setRef] = useState(null);
const onResize = useCallback(() => setHeight(window.innerHeight - 240), []); const onResize = useCallback(() => setHeight(window.innerHeight - 120), []);
useEffect(() => { useEffect(() => {
window.addEventListener("resize", onResize); window.addEventListener("resize", onResize);
@ -60,7 +60,7 @@ const ScrollDialog: FC<IProps> = ({
<div <div
className={classNames(styles.content, { className={classNames(styles.content, {
has_buttons: !!buttons, has_buttons: !!buttons,
has_title: true has_title: !!title,
})} })}
style={{ flexBasis: width }} style={{ flexBasis: width }}
> >

View file

@ -20,17 +20,17 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
padding: 0; padding: 10px 0 0 0;
box-sizing: border-box; box-sizing: border-box;
flex: 1 1 800px; flex: 1 1 800px;
z-index: 1; z-index: 1;
&:global(.has_title) { &:global(.has_title) {
padding-top: 64px + 15px; // +15px padding-top: 60px + 10px; // +15px
} }
&:global(.has_buttons) { &:global(.has_buttons) {
padding-bottom: 64px + 15px; // +15px padding-bottom: 60px + 10px; // +15px
} }
} }
@ -51,6 +51,11 @@
} }
.top { .top {
height: 10px;
top: 0;
&:global(.has_buttons) { height: 60px; top: 15px;}
.wrap { .wrap {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;

View file

@ -10,7 +10,7 @@ export interface IModalState {
const INITIAL_STATE: IModalState = { const INITIAL_STATE: IModalState = {
is_shown: true, is_shown: true,
dialog: DIALOGS.LOGIN, dialog: DIALOGS.TEST,
}; };
export default createReducer(INITIAL_STATE, MODAL_HANDLERS); export default createReducer(INITIAL_STATE, MODAL_HANDLERS);