aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddhant Khare <[email protected]>2021-04-13 12:13:58 +0530
committerSiddhant Khare <[email protected]>2021-04-13 12:13:58 +0530
commit2148903389e451a7b0d1662fd255487b403fa990 (patch)
treed36a66415c953affe30e44eeb05e7c4091adf6a1
parentfixed Watermark CSS and Updated Copyright year (diff)
downloadctrl-v-2148903389e451a7b0d1662fd255487b403fa990.tar.xz
ctrl-v-2148903389e451a7b0d1662fd255487b403fa990.zip
added reposnvie design for small & mobile screen
-rw-r--r--frontend/src/components/Inputs/Password.js27
-rw-r--r--frontend/src/components/Options.js74
2 files changed, 55 insertions, 46 deletions
diff --git a/frontend/src/components/Inputs/Password.js b/frontend/src/components/Inputs/Password.js
index 099aae4..c242b45 100644
--- a/frontend/src/components/Inputs/Password.js
+++ b/frontend/src/components/Inputs/Password.js
@@ -1,14 +1,17 @@
import React from "react";
-import {Labelled} from "../decorators/Labelled";
-import {Input} from "../Common/Input";
+import { Labelled } from "../decorators/Labelled";
+import { Input } from "../Common/Input";
-export const Password = (props) => <Labelled label="password">
- <Input
- name="pass"
- placeholder={props.placeholder ?? "add password"}
- type="password"
- autoComplete="off"
- onChange={props.onChange}
- value={props.value}
- id={props.id} />
-</Labelled> \ No newline at end of file
+export const Password = (props) => (
+ <Labelled label="password">
+ <Input
+ name="pass"
+ placeholder={props.placeholder ?? "add password"}
+ type="password"
+ autoComplete="off"
+ onChange={props.onChange}
+ value={props.value}
+ id={props.id}
+ />
+ </Labelled>
+);
diff --git a/frontend/src/components/Options.js b/frontend/src/components/Options.js
index 97d3127..25484e3 100644
--- a/frontend/src/components/Options.js
+++ b/frontend/src/components/Options.js
@@ -1,39 +1,45 @@
-import React from 'react';
-import styled from 'styled-components'
-import { Password, Expiry, Language } from './Inputs'
+import React from "react";
+import styled from "styled-components";
+import { Password, Expiry, Language } from "./Inputs";
const Flex = styled.div`
- float: right;
- display: flex;
- flex-direction: row;
- transform: translateY(0.2em);
-
- & > *:not(:first-child) {
- margin-left: 2em;
- }
+ float: right;
+ display: flex;
+ flex-direction: row;
+ transform: translateY(0.2em);
- @media (max-width: 850px) {
- float: none !important;
- }
-`
+ & > *:not(:first-child) {
+ margin-left: 2em;
+ }
-const OptionsContainer = ({pass, lang, expiry, onPassChange, onLangChange, onExpiryChange}) => {
- return (
- <Flex>
- <Password
- value={pass}
- onChange={onPassChange}
- id="passwordInput" />
- <Language
- value={lang}
- onChange={onLangChange}
- id="langInput" />
- <Expiry
- value={expiry}
- onChange={onExpiryChange}
- id="expiryInput" />
- </Flex>
- );
-}
+ @media (max-width: 850px) {
+ position: auto;
+ display: inline-flex;
+ }
+ @media (max-width: 650px) {
+ position: relative;
+ float: none !important;
+ width: 100%;
+ display: inline-table;
+ text-align: center;
+ }
+`;
-export default OptionsContainer \ No newline at end of file
+const OptionsContainer = ({
+ pass,
+ lang,
+ expiry,
+ onPassChange,
+ onLangChange,
+ onExpiryChange,
+}) => {
+ return (
+ <Flex>
+ <Password value={pass} onChange={onPassChange} id="passwordInput" />
+ <Language value={lang} onChange={onLangChange} id="langInput" />
+ <Expiry value={expiry} onChange={onExpiryChange} id="expiryInput" />
+ </Flex>
+ );
+};
+
+export default OptionsContainer;