Skip to content

Commit 82a99c7

Browse files
committed
SD-20: Update file structure
1 parent 50c4ce4 commit 82a99c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+30
-30
lines changed

.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Preview } from '@storybook/react';
22

3-
import Providers from '../src/domains/common/providers/Providers';
3+
import Providers from '../src/domains/shared/components/Providers';
44

55
// TODO: Add after chromatic setup
66
// MotionGlobalConfig.skipAnimations = isChromatic();

eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ export default tseslint.config(
140140
},
141141
],
142142
patterns: [{
143-
regex: 'src/(?!(domains/.*/(components|utils|assets|hooks|providers|types|styles)/.*))',
143+
regex: 'src/(?!(domains/.*/(components|utils|assets|types)/.*))',
144144
message: 'Organize modules in predefined groups under domains.',
145145
}, {
146146
/*
147147
Modules are often divided into sub-modules for readability and maintainability, where those
148148
sub-modules are internal to the "root" modules. This rule prevents importing those sub-modules
149149
(which happens often by laziness or an overlook) in order to keep the modules SOLID.
150150
*/
151-
group: ['src/domains/*/*/*/**', '!#src/domains/*/*/*/**.mock'],
151+
group: ['!#src/domains/*/*/*/**.mock'],
152152
message: 'Direct importing of sub-modules is not allowed. Turn the sub-module into a root module' +
153153
' or reexport it from the "owning" module if you really need to use it directly.',
154154
}, {

scripts/generateIcons.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
55
const __filename = fileURLToPath(import.meta.url);
66
const __dirname = path.dirname(__filename);
77
const rootDir = path.resolve(__dirname, '..');
8-
const iconsDir = path.join(rootDir, 'src/domains/common/components/CIcon/icons');
8+
const iconsDir = path.join(rootDir, 'src/domains/shared/components/CIcon/icons');
99

1010
if (!fs.existsSync(iconsDir)) {
1111
console.error(`Icons directory not found: ${iconsDir}`);
@@ -40,7 +40,7 @@ export type IconName = keyof typeof icons;
4040
`;
4141

4242
fs.writeFileSync(
43-
path.join(rootDir, 'src/domains/common/components/CIcon/icons.ts'),
43+
path.join(rootDir, 'src/domains/shared/components/CIcon/icons.ts'),
4444
content
4545
);
4646

src/App.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import styled from 'styled-components';
22

3-
import CIcon from 'src/domains/common/components/CIcon';
4-
import { useTheme } from 'src/domains/common/hooks/useTheme';
5-
import Providers from 'src/domains/common/providers/Providers';
3+
import CIcon from 'src/domains/shared/components/CIcon';
4+
import Providers from 'src/domains/shared/components/Providers';
5+
import { useTheme } from 'src/domains/shared/utils/useTheme';
66

77
const App = () => {
8-
const { userSelectedTheme, setTheme } = useTheme();
8+
const { setTheme } = useTheme();
99
return (
1010
<Providers>
1111
shielding dapp
@@ -14,9 +14,6 @@ const App = () => {
1414
<Button onClick={() => void setTheme('dark')}>dark</Button>
1515
<Button onClick={() => void setTheme('system')}>system</Button>
1616
</ThemeSelector>
17-
Current theme:
18-
{' '}
19-
{userSelectedTheme}
2017
<CIcon icon="Shielded" size={32} />
2118
</Providers>
2219
);

src/domains/common/styles/utils/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/domains/common/components/CIcon/icons/addCircle.svg renamed to src/domains/shared/components/CIcon/icons/addCircle.svg

File renamed without changes.

src/domains/common/components/CIcon/icons/addSquare.svg renamed to src/domains/shared/components/CIcon/icons/addSquare.svg

File renamed without changes.

0 commit comments

Comments
 (0)