-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(): Adding more boilerplate code (#12)
- Loading branch information
1 parent
76a2406
commit 67b9eb0
Showing
82 changed files
with
4,078 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
module.exports = { | ||
presets: ['@babel/preset-env'], | ||
}; | ||
w; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,40 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { LocalizationProvider, ModalProvider, ThemeProvider } from '@providers'; | ||
import { Button } from '@chakra-ui/react'; | ||
import { useShallow } from 'zustand/react/shallow'; | ||
import { appStore, modalSelector, ModalID } from '@uiStore'; | ||
import { HelmetProvider } from 'react-helmet-async'; | ||
import { | ||
LocalizationProvider, | ||
ModalProvider, | ||
RouterProvider, | ||
ThemeProvider, | ||
} from '@providers'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; | ||
|
||
function App() { | ||
const { t } = useTranslation(); | ||
const { openModal } = appStore(useShallow(modalSelector)); | ||
const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: 5, | ||
retryDelay: 1000, | ||
}, | ||
}, | ||
}); | ||
|
||
const App = () => { | ||
return ( | ||
<ThemeProvider> | ||
<ModalProvider> | ||
<React.StrictMode> | ||
<LocalizationProvider> | ||
<Button onClick={() => openModal(ModalID.SEARCH, () => {})}> | ||
{t('Click me')} | ||
</Button> | ||
<div>{t('App')}</div> | ||
</LocalizationProvider> | ||
</React.StrictMode> | ||
</ModalProvider> | ||
</ThemeProvider> | ||
<QueryClientProvider client={queryClient}> | ||
<React.StrictMode> | ||
<LocalizationProvider> | ||
<HelmetProvider> | ||
<ThemeProvider> | ||
<ModalProvider> | ||
<RouterProvider /> | ||
</ModalProvider> | ||
</ThemeProvider> | ||
</HelmetProvider> | ||
</LocalizationProvider> | ||
</React.StrictMode> | ||
<ReactQueryDevtools initialIsOpen={false} /> | ||
</QueryClientProvider> | ||
); | ||
} | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { IconDay, IconHourcoding, IconNight } from './IconsAssets'; | ||
import { HourcodingIconProps, IconHc } from './types'; | ||
|
||
const HourcodingIcon = ({ icon, ...rest }: HourcodingIconProps) => { | ||
switch (icon) { | ||
case IconHc.DAY: | ||
return <IconDay {...rest} />; | ||
case IconHc.HOURCODING: | ||
return <IconHourcoding {...rest} />; | ||
case IconHc.NIGHT: | ||
return <IconNight {...rest} />; | ||
default: | ||
return null; | ||
} | ||
}; | ||
|
||
export default HourcodingIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
|
||
export const IconDay = (props: React.SVGProps<SVGSVGElement>) => { | ||
return ( | ||
<svg | ||
fill="currentColor" | ||
viewBox="0 0 16 16" | ||
height="1em" | ||
width="1em" | ||
{...props} | ||
> | ||
<path d="M8 11a3 3 0 110-6 3 3 0 010 6zm0 1a4 4 0 100-8 4 4 0 000 8zM8 0a.5.5 0 01.5.5v2a.5.5 0 01-1 0v-2A.5.5 0 018 0zm0 13a.5.5 0 01.5.5v2a.5.5 0 01-1 0v-2A.5.5 0 018 13zm8-5a.5.5 0 01-.5.5h-2a.5.5 0 010-1h2a.5.5 0 01.5.5zM3 8a.5.5 0 01-.5.5h-2a.5.5 0 010-1h2A.5.5 0 013 8zm10.657-5.657a.5.5 0 010 .707l-1.414 1.415a.5.5 0 11-.707-.708l1.414-1.414a.5.5 0 01.707 0zm-9.193 9.193a.5.5 0 010 .707L3.05 13.657a.5.5 0 01-.707-.707l1.414-1.414a.5.5 0 01.707 0zm9.193 2.121a.5.5 0 01-.707 0l-1.414-1.414a.5.5 0 01.707-.707l1.414 1.414a.5.5 0 010 .707zM4.464 4.465a.5.5 0 01-.707 0L2.343 3.05a.5.5 0 11.707-.707l1.414 1.414a.5.5 0 010 .708z" /> | ||
</svg> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
export const IconHourcoding = (props: React.SVGProps<SVGSVGElement>) => { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" {...props}> | ||
<path | ||
fill="currentColor" | ||
d="M26 13h76c0 13.656-.583 24.046-10 34-3.795 3.652-7.614 7.076-12 10l1 3c.068 1.478.085 2.958.063 4.438l-.028 2.308L81 69v4c1.95 1.406 3.96 2.73 6 4 8.07 7.263 12.317 14.475 15 25v14H26c0-14.766 1.283-24.99 11-36 2.532-2.243 5.158-4.171 8-6l3-2-1-3a72.563 72.563 0 01-.063-4.438l.028-2.308L47 60v-4c-1.978-1.677-1.978-1.677-4.563-3.125C32.89 46.515 28.733 37.93 26 27V13zm13 12c1.21 7.265 3.525 12.159 9.293 16.875C55.479 46.752 61.323 47.92 70 47c7.682-2.39 13.208-6.84 17.027-13.898C88.324 30.269 89 28.134 89 25H39zm21.063 36.125c-1.327 1.91-1.327 1.91-.75 4.563L60 68c4.095 1.142 4.095 1.142 7.938-.125 1.326-1.91 1.326-1.91.75-4.563L68 61c-4.095-1.142-4.095-1.142-7.938.125zm-15.5 29.25C41.404 94.472 39 98.722 39 104h50c-1.21-7.265-3.525-12.159-9.293-16.875-11.574-7.854-25.332-7.43-35.144 3.25z" | ||
></path> | ||
</svg> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as React from 'react'; | ||
|
||
export const IconNight = (props: React.SVGProps<SVGSVGElement>) => { | ||
return ( | ||
<svg | ||
viewBox="0 0 24 24" | ||
fill="currentColor" | ||
height="1em" | ||
width="1em" | ||
{...props} | ||
> | ||
<path d="M9.57 3.38a8 8 0 0010.4 10.4 1 1 0 011.31 1.3 10 10 0 11-13-13 1 1 0 011.3 1.3zM7.1 5.04a8 8 0 1011.2 11.23A10 10 0 017.08 5.04z" /> | ||
</svg> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { IconDay } from './Day'; | ||
export { IconHourcoding } from './Hourcoding'; | ||
export { IconNight } from './Night'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { render } from '@testing-library/react'; | ||
|
||
import { IconDay, IconHourcoding, IconNight } from '../IconsAssets'; | ||
|
||
describe('Icons', () => { | ||
it('should render IconDay icon', () => { | ||
const { container } = render(<IconDay />); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render IconHourcoding icon', () => { | ||
const { container } = render(<IconHourcoding />); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render IconNight icon', () => { | ||
const { container } = render(<IconNight />); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.