-
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.
TG 1087 Maintenance - Migrating from Styled-Components to CSS Modules (…
…#38) * Remove components boilerplate * Remove common components * TG-1099 Remove theme switch feature and remove all redux related dependencies * TG-1097 Refactor all components to use css modules and remove styled-component dependency * TG-1097 Add new css modules * Restore project name and remove themed logos * Fix next config and group imports --------- Co-authored-by: Luca <[email protected]>
- Loading branch information
1 parent
414b79f
commit ac3a0a0
Showing
29 changed files
with
88 additions
and
910 deletions.
There are no files selected for viewing
7 changes: 2 additions & 5 deletions
7
{{cookiecutter.project_dirname}}/__tests__/components/Navbar.test.tsx
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,13 +1,10 @@ | ||
import { expect } from '@jest/globals' | ||
import { screen } from '@testing-library/react' | ||
import { render, screen } from '@testing-library/react' | ||
import React from 'react' | ||
|
||
import { Navbar } from '@/components/Navbar' | ||
import { renderWithWrappers } from '../functions' | ||
|
||
const setup = () => renderWithWrappers(<Navbar />) | ||
|
||
test('Navbar renders correctly', () => { | ||
setup() | ||
render(<Navbar />) | ||
expect(screen.getByRole('img')).toBeTruthy() | ||
}) |
24 changes: 0 additions & 24 deletions
24
{{cookiecutter.project_dirname}}/__tests__/components/ThemeSwitch.test.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
12 changes: 0 additions & 12 deletions
12
{{cookiecutter.project_dirname}}/public/images/logo-dark.svg
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
{{cookiecutter.project_dirname}}/public/images/logo-light.svg
This file was deleted.
Oops, something went wrong.
23 changes: 4 additions & 19 deletions
23
{{cookiecutter.project_dirname}}/src/components/Navbar.tsx
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,34 +1,19 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import styles from '@/styles/navbar.module.css' | ||
|
||
import { ThemeSwitch } from '@/components/ThemeSwitch' | ||
import Image from 'next/image' | ||
import { useAppSelector } from '@/store' | ||
|
||
const Navbar = () => { | ||
const theme = useAppSelector(state => state.utils.theme) | ||
|
||
return ( | ||
<Nav> | ||
<nav className={styles.navbar}> | ||
<Image | ||
src={`/images/logo-${theme}.svg`} | ||
src={`/images/logo.svg`} | ||
width='110' | ||
height='48' | ||
alt={'sito logo'} | ||
/> | ||
<ThemeSwitch /> | ||
</Nav> | ||
</nav> | ||
) | ||
} | ||
|
||
const Nav = styled.nav` | ||
width: 100%; | ||
background-color: ${({ theme }) => theme.colors.neutrals[100]}; | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 5px; | ||
` | ||
|
||
export { Navbar } |
83 changes: 0 additions & 83 deletions
83
{{cookiecutter.project_dirname}}/src/components/ThemeSwitch.tsx
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
{{cookiecutter.project_dirname}}/src/components/commons/Button.tsx
This file was deleted.
Oops, something went wrong.
62 changes: 0 additions & 62 deletions
62
{{cookiecutter.project_dirname}}/src/components/commons/Input.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.