Skip to content

Commit

Permalink
Merge branch 'master' into issue-551
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaam authored Sep 10, 2024
2 parents 46c2c43 + 3adda40 commit ec9f9b7
Show file tree
Hide file tree
Showing 78 changed files with 1,997 additions and 247 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"test": "vitest"
},
"dependencies": {
"@hookform/resolvers": "3.9.0",
"@redux-devtools/extension": "3.3.0",
"@sentry/react": "7.102.0",
"classnames": "2.5.1",
Expand All @@ -52,8 +53,10 @@
"normalize.css": "8.0.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.53.0",
"react-i18next": "13.5.0",
"react-router-dom": "6.22.1",
"zod": "3.23.8",
"zustand": "4.5.1"
},
"devDependencies": {
Expand Down
30 changes: 30 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ReactNode } from 'react';
import { HashRouter as Router, Route } from 'react-router-dom';
import { BrowserRouter, Route } from 'react-router-dom';

import { ErrorBoundary } from '@sentry/react';

import Home from './pages/home/home';
import Register from './pages/register/register';

import SentryRoutes from '~components/SentrySetup/SentrySetup';

Expand All @@ -13,13 +14,12 @@ import './styles/base.scss';
function App(): ReactNode {
return (
<ErrorBoundary fallback={<p>Ocorreu um erro inesperado!</p>}>
<div>
<Router>
<SentryRoutes>
<Route element={<Home />} path="/" />
</SentryRoutes>
</Router>
</div>
<BrowserRouter>
<SentryRoutes>
<Route element={<Home />} path="/" />
<Route element={<Register />} path="/register" />
</SentryRoutes>
</BrowserRouter>
</ErrorBoundary>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@
@include text($primaryWhite, rgba(255, 255, 255, 0.15));
}

&.gray {
@include text($secondaryGray, $primaryGray);
}

&.disabled {
&:hover {
background: none;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HTMLAttributes, ReactElement } from 'react';

export type IButtonProps = HTMLAttributes<HTMLButtonElement> & {
color?: 'primary' | 'secondary';
color?: 'gray' | 'primary' | 'secondary';
disabled?: boolean;
type?: 'button' | 'reset' | 'submit';
variant?: 'container' | 'outlined' | 'text';
Expand Down
14 changes: 9 additions & 5 deletions src/components/FeedbackError/FeedbackError.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ import FeedbackError from './FeedbackError';
import { TFeedbackErrorProps } from './FeedbackError.type';

export const FeedbackErrorComponent: Story<TFeedbackErrorProps> = (props) => {
const setErrors = useError((state) => state.setError);
const { addError, removeError } = useError();

useEffect(() => {
for (const error of props.errors) {
setErrors(error.message);
}
}, [props.errors, setErrors]);
const newErrorIds = props.errors.map((error) => addError(error));

return (): void => {
for (const errorId of newErrorIds) removeError(errorId);
};
}, []);

return <FeedbackError />;
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/FeedbackError/FeedbackError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function FeedbackError(): ReactNode {
variants={animationVariants}
>
{Object.values(errors).map((error) => (
<li key={error.id}>{error.message}</li>
<li key={error.message}>{error.message}</li>
))}
</motion.ul>
</AnimatePresence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ import { useError } from '~stores/useError/useError';
import FeedbackErrorMobile from './FeedbackErrorMobile';

export const FeedbackErrorComponent: Story = () => {
const setErrors = useError((state) => state.setError);
const { addError, removeError } = useError();

useEffect(() => {
setErrors('mensagem de erro');
}, [setErrors]);
const newErrorId = addError({ message: 'error message' });

return (): void => {
removeError(newErrorId);
};
}, []);

return <FeedbackErrorMobile />;
};
4 changes: 4 additions & 0 deletions src/components/Icon/data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Alert from './icons/alert.svg?react';
import ArrowRight from './icons/arrow-right.svg?react';
import BlindEye from './icons/blind-eye.svg?react';
import Check from './icons/check.svg?react';
import Circle from './icons/circle.svg?react';
import Close from './icons/close.svg?react';
Expand All @@ -9,6 +10,7 @@ import Facebook from './icons/facebook.svg?react';
import Hamburguer from './icons/hamburguer.svg?react';
import Instagram from './icons/instagram.svg?react';
import LeftArrow from './icons/left-arrow.svg?react';
import Letter from './icons/letter.svg?react';
import Mag from './icons/mag.svg?react';
import Minus from './icons/minus.svg?react';
import Mobile from './icons/Mobile.svg?react';
Expand All @@ -26,6 +28,7 @@ import Twitter from './icons/twitter.svg?react';
export const icons = {
alert: Alert,
'arrow-right': ArrowRight,
'blind-eye': BlindEye,
check: Check,
circle: Circle,
close: Close,
Expand All @@ -34,6 +37,7 @@ export const icons = {
hamburguer: Hamburguer,
instagram: Instagram,
'left-arrow': LeftArrow,
letter: Letter,
mag: Mag,
minus: Minus,
mobile: Mobile,
Expand Down
4 changes: 4 additions & 0 deletions src/components/Icon/icons/blind-eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/components/Icon/icons/instagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/components/Icon/icons/letter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/components/Icon/icons/tiktok.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/components/Icon/icons/twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('ComposeEditor', () => {
await userEvent.type(inputElement, testInputValue);

expect(inputElement).toHaveValue(testInputValue);
expect(mockOnChange).toHaveBeenCalledWith(testInputValue);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ textarea {

.charactersLimitContainer {
display: flex;
flex-wrap: wrap;

justify-content: space-between;

Expand All @@ -32,6 +33,7 @@ textarea {

.characterLimitWrapper {
display: flex;
flex-wrap: wrap;
gap: 0.8rem;

align-items: center;
Expand Down
Loading

0 comments on commit ec9f9b7

Please sign in to comment.