Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(liveness): use gov design colors and fix global css #39

Merged
merged 25 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4da3f24
[REF] ui/ux
JE1999 Jun 21, 2023
94a86a4
[REF] MUI button style
JE1999 Jun 21, 2023
218c8cd
[ADD] disabled button if is pwned
JE1999 Jun 21, 2023
1a50056
library update
JE1999 Jun 21, 2023
0714591
[REF] footer and themes
JE1999 Jun 21, 2023
a0d9c19
[REF] ui/ux
JE1999 Jun 21, 2023
0402c97
[REF] link to home
JE1999 Jun 21, 2023
49b087f
[ADD] cedula validation if the user exists
JE1999 Jun 21, 2023
2d89531
[ADD] link to ogtic
JE1999 Jun 21, 2023
c539601
[ADD] link to log in
JE1999 Jun 21, 2023
e9399dc
[REF] background textfield
JE1999 Jun 21, 2023
f3648ca
[ADD] color FaceLivenessDetector
JE1999 Jun 21, 2023
4bb5e60
[REF] stepper ui
JE1999 Jun 22, 2023
b8114e7
chore: lint all files, removed unused code, fix Luhn
gustavovalverde Jun 22, 2023
30561ad
lint: run prettier
gustavovalverde Jun 22, 2023
61db9a6
fix(api): do not return Surnameto the frontend
gustavovalverde Jun 22, 2023
8fad947
imp(ui): remove filled variant from fields
gustavovalverde Jun 22, 2023
0dea2ae
fix(liveness): re-rendering error
gustavovalverde Jun 22, 2023
fd73a9f
[REF] color FaceLivenessDetector
JE1999 Jun 22, 2023
d0106a0
Merge branch 'master' of https://github.com/opticrd/auth-registry-fro…
JE1999 Jun 22, 2023
0ef432e
fix(css): issues betweeen yarn `build` and `start`
gustavovalverde Jun 23, 2023
35ddcb6
chore: remove unused code
gustavovalverde Jun 23, 2023
56e00a8
chore(css): missing variables
gustavovalverde Jun 23, 2023
6339337
fix(liveness): regressive count
gustavovalverde Jun 23, 2023
1ada35c
fix(liveness): center faces
gustavovalverde Jun 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 3 additions & 35 deletions src/components/biometric/face-liveness-detector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FaceLivenessDetector } from '@aws-amplify/ui-react-liveness';
import { Loader, Theme, ThemeProvider, useTheme } from '@aws-amplify/ui-react';
import { Loader, ThemeProvider } from '@aws-amplify/ui-react';

import React from 'react';
import { useState, useEffect } from 'react';
Expand All @@ -8,8 +8,6 @@ import { useSnackbar } from '@/components/elements/alert';
import { defaultLivenessDisplayText } from './displayText';

export function LivenessQuickStartReact({ handleNextForm, cedula }: any) {
// const { tokens } = useTheme();

const next = handleNextForm;
const id = cedula;
const [loading, setLoading] = useState<boolean>(true);
Expand Down Expand Up @@ -56,43 +54,13 @@ export function LivenessQuickStartReact({ handleNextForm, cedula }: any) {
if (error) {
AlertError('No se ha podido validar correctamente la identidad.');
}
// TODO: AlertError is causing re-rendering issues. But not adding it causes eslint error.
// TODO: AlertError is causing re-rendering issues. But not adding it causes eslint error.
}, [error]);

const theme: Theme = {
name: 'Face Liveness Theme',
tokens: {
colors: {
background: {
primary: {
// value: tokens.colors.neutral['90'].value,
value: '#fff',
},
secondary: {
// value: tokens.colors.neutral['100'].value,
value: '#000',
},
},
font: {
primary: {
// value: tokens.colors.white.value,
value: '#000',
},
},
brand: {
primary: {
'80': '#003876',
'90': '#003876',
},
},
},
},
};

return (
<>
<br />
<ThemeProvider theme={theme}>
<ThemeProvider>
{loading ? (
<Loader />
) : (
Expand Down
1 change: 0 additions & 1 deletion src/components/elements/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ interface IButtonApp {
}

export const ButtonApp = ({
outlined,
disabled,
variant = 'contained',
submit,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/register/stepper/step2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { useCallback, useState } from 'react';

import {
Box,
Button,
FormControlLabel,
FormGroup,
Checkbox,
Grid,
Typography,
} from '@mui/material';
import Step2Modal from './step2Modal';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/register/stepper/step2Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function Step2Modal({
<div
style={{
width: '100%',
maxWidth: '600px',
maxWidth: '700px',
margin: 'auto',
padding: '0 10px',
}}
Expand Down
104 changes: 83 additions & 21 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,61 +1,64 @@
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600&display=swap");
/* Variables */
:root {
--primary-color: #003876;
--success-color: #2ecc71;
--secondary-color: #0087ff;
--error-color: #ee2a24;
--info-color: #23c3df;
}

/* Global styles */
body {
font-family: Poppins, sans-serif;
background-image: url("../../public/assets/forma.png") !important;
font-family: 'Poppins', sans-serif;
background-image: url('../../public/assets/forma.png');
background-repeat: no-repeat;
background-position: right;
background-size: 300px;
}

.swal2-container {
z-index: 1600 !important;
}

.text-bold {
font-weight: bold;
}

/* Text utility classes */
.text-primary {
color: #003876;
color: var(--primary-color);
}

.text-success {
color: #2ecc71;
color: var(--success-color);
}

.text-secondary {
color: #0087ff;
color: var(--secondary-color);
}

.text-error {
color: #ee2a24;
color: var(--error-color);
}

.text-info {
color: #23c3df;
color: var(--info-color);
}

/* Background utility classes */
.bg-primary {
background: #003876;
background: var(--primary-color);
}

.bg-success {
background: #2ecc71;
background: var(--success-color);
}

.bg-secondary {
background: #0087ff;
background: var(--secondary-color);
}

.bg-error {
background: #ee2a24;
background: var(--error-color);
}

.bg-info {
background: #23c3df;
background: var(--info-color);
}

/* Padding utility classes */
.p-1 {
padding: 5px;
}
Expand Down Expand Up @@ -137,3 +140,62 @@ body {
z-index: 500 !important;
padding: 450px;
}

/* Face live */

.amplify-card {
background: transparent;
}

.amplify-alert {
background: #b8cef9 !important;
}

.amplify-alert__heading,
.amplify-alert__body,
.amplify-icon {
color: var(--primary-color);
}

.amplify-text {
/* TODO: this is to fix regresive count, but this is not the right approach*/
color: rgb(211, 211, 211) !important;
}

.amplify-button {
background: white;
border: 1px solid #003876;
color: var(--primary-color);
}

.amplify-button:hover {
background: #e3e3e3;
color: var(--primary-color);
border: 1px solid #003876;
}

[data-amplify-theme] {
/* --amplify-colors-background-primary: var(--primary-color); */
--amplify-colors-font-primary: white;
/* --amplify-colors-brand-primary-10: var(--primary-color); */
/* --amplify-colors-brand-primary-80: var(--primary-color);
--amplify-colors-brand-primary-90: var(--primary-color);
--amplify-colors-brand-primary-100: var(--primary-color); */
}

.amplify-flex.amplify-liveness-figures {
margin: 0 auto;
}

.amplify-liveness-instruction-overlay div .amplify-liveness-toast {
background: white;
color: var(--primary-color);
}

.amplify-liveness-toast__message div p {
color: black !important;
}

.amplify-liveness-toast--default div .amplify-liveness-toast__message {
color: black;
}