Closed Hanan795 closed 4 years ago
make the design look like what we make on Figma
great job :100:
I did that at the back end side, why to do it on the front end?
On Tue, Jul 14, 2020 at 10:53 AM Yakoob Hammouri notifications@github.com wrote:
@YakoobHammouri requested changes on this pull request.
In client/src/components/Login/index.js https://github.com/GSG-K3/bills-system-analysis/pull/75#discussion_r454171103 :
- FormControl,
- FormHelperText, +} from '@material-ui/core'; +import Style from './style';
+function Login(props) {
- const classes = Style();
- const [email, setEmail] = useState('');
- const [password, setPassword] = useState('');
- const [message, setMessage] = useState('');
- const handleForm = (e) => {
- e.preventDefault();
- const data = { email, password };
add validation here to check values, email format .... you can using this validation to check the email form
import XRegExp from 'xregexp'; const validateEmail = (email) => { const re = /^(([^<>()[]\.,;:\s@ "]+(.[^<>()[]\.,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); };
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/GSG-K3/bills-system-analysis/pull/75#pullrequestreview-447871530, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO6JDVLWKVQQS6DFGYM2ETR3QFHTANCNFSM4OYGMOLA .
I did that at the back end side, why to do it on the front end? … On Tue, Jul 14, 2020 at 10:53 AM Yakoob Hammouri @.> wrote: @YakoobHammouri requested changes on this pull request. ------------------------------ In client/src/components/Login/index.js <#75 (comment)> : > + FormControl, + FormHelperText, +} from @./core'; +import Style from './style'; + +function Login(props) { + const classes = Style(); + + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [message, setMessage] = useState(''); + + const handleForm = (e) => { + e.preventDefault(); + const data = { email, password }; + add validation here to check values, email format .... you can using this validation to check the email form import XRegExp from 'xregexp'; const validateEmail = (email) => { const re = /^(([^<>()[]\.,;:\s@ "]+(.[^<>()[]\.,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); }; — You are receiving this because you were assigned. Reply to this email directly, view it on GitHub <#75 (review)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO6JDVLWKVQQS6DFGYM2ETR3QFHTANCNFSM4OYGMOLA .
I know, but we must do validation in client to reduce the number of failed requests to the server , why send a request with null or undefined values or the email does not have a valid format, this cases must handle in a client
Ok
On Tue, Jul 14, 2020 at 11:22 AM Yakoob Hammouri notifications@github.com wrote:
I did that at the back end side, why to do it on the front end? … <#m7209102034382834721> On Tue, Jul 14, 2020 at 10:53 AM Yakoob Hammouri @.> wrote: @YakoobHammouri https://github.com/YakoobHammouri requested changes on this pull request. ------------------------------ In client/src/components/Login/index.js <#75 (comment) https://github.com/GSG-K3/bills-system-analysis/pull/75#discussion_r454171103> : > + FormControl, + FormHelperText, +} from @./core'; +import Style from './style'; + +function Login(props) { + const classes = Style(); + + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [message, setMessage] = useState(''); + + const handleForm = (e) => { + e.preventDefault(); + const data = { email, password }; + add validation here to check values, email format .... you can using this validation to check the email form import XRegExp from 'xregexp'; const validateEmail = (email) => { const re = /^(([^<>()[].,;:\s@ "]+(.[^<>()[].,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); }; — You are receiving this because you were assigned. Reply to this email directly, view it on GitHub <#75 (review) https://github.com/GSG-K3/bills-system-analysis/pull/75#pullrequestreview-447871530>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO6JDVLWKVQQS6DFGYM2ETR3QFHTANCNFSM4OYGMOLA .
I know, but we must do validation in client to reduce the number of failed requests to the server , why send a request with null or undefined values or the email does not have a valid format, this cases must handle in a client
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/GSG-K3/bills-system-analysis/pull/75#issuecomment-658043294, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO6JDQO5YR6PXGR37YC3WDR3QITXANCNFSM4OYGMOLA .
the functionality of login on the front end side
style of the page