Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bb533f4
fix: add UTF-8 to index.html
furtivite Dec 6, 2024
f60b540
feat: make about page
furtivite Dec 6, 2024
290f15e
feat: add deploy script
furtivite Dec 9, 2024
3d3b656
feat: type 1_base
furtivite Dec 15, 2024
9cbe66c
feat: repair 2_repair
furtivite Dec 15, 2024
05d356a
feat" create 3_write
furtivite Dec 15, 2024
02826c5
Merge pull request #1 from furtivite/homework1
furtivite Dec 23, 2024
c748371
feat: create homework 2 (#2)
furtivite Dec 24, 2024
46222bd
fix: delete class
furtivite Dec 24, 2024
ba974f1
feat: create new script
furtivite Dec 24, 2024
9fbcd48
feat: change storybook deploy path
furtivite Dec 24, 2024
325c9d9
feat: create homework 2 (#3)
furtivite Dec 25, 2024
21c65e3
feat: improvements (#4)
furtivite Dec 25, 2024
0f43505
feat: create homework 3 (#5)
furtivite Jan 16, 2025
8d225d3
fix: react-rouyter at gh-pages problem
furtivite Jan 16, 2025
ce9b68d
Revert "fix: react-rouyter at gh-pages problem"
furtivite Jan 16, 2025
8bc192e
feat: changed mainpage
furtivite Jan 16, 2025
d5d9e35
feat: move routing
furtivite Jan 20, 2025
ab6b4a4
feat: create homework 4 (#6)
furtivite Jan 27, 2025
2a946d6
feat: create homework 5 (#7)
furtivite Feb 3, 2025
6fa0183
feat: add pattern (#8)
furtivite Feb 7, 2025
119642f
feat: create Slider (#9)
furtivite Feb 19, 2025
97e2d8a
fix: review (#10)
furtivite Feb 19, 2025
adb1241
fix: strorybook (#11)
furtivite Feb 21, 2025
7600c88
feat: create practice 2 (#12)
furtivite Mar 3, 2025
afa8f9c
feat: Create forms (#13)
furtivite Mar 10, 2025
5f5dd7f
feat: make homework for jest (#14)
furtivite Mar 12, 2025
b870117
feat: create routing (#15)
furtivite Mar 12, 2025
1b9aa8f
feat: changed gh-action
furtivite Mar 17, 2025
487b309
fix: create routing (#16)
furtivite Apr 10, 2025
ab10fe8
fix: remove nanoid
furtivite Apr 10, 2025
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
24 changes: 12 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ jobs:
branch: gh-pages
folder: dist

# # Собираем Storybook
# - name: Build Storybook
# run: npm run build-storybook
#
# # Публикуем Storybook на Github Pages
# - name: Deploy Storybook to Github Pages
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: storybook-static
# commit-message: "Automatically publish Storybook"
# # Собираем Storybook
# - name: Build Storybook
# run: npm run build-storybook

# # Публикуем Storybook на Github Pages
# - name: Deploy Storybook to Github Pages
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: storybook-static
# commit-message: "Automatically publish Storybook"

# Останавливаем выполнение строго при неудачных тестах
- name: Fail on failed tests
run: |
if [ ${{ job.status }} == 'failure' ]; then exit 1; fi;
if [ ${{ job.status }} == 'failure' ]; then exit 1; fi;
40 changes: 40 additions & 0 deletions .storybook/decorators/StoreDecorator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import {
defaultContext,
ELangVariables,
EThemeVariables,
IStoreContext,
StoreContext,
} from '../../src/app/StoreContext';

export default function StoreDecorator(Story: any) {
const [contextValue, setContextValue] = React.useState<IStoreContext>(defaultContext);

const { theme, lang } = contextValue;
const { i18n } = useTranslation();

const themeSwitchHandler = (): void => {
if (theme === 'light') {
setContextValue({ ...contextValue, theme: EThemeVariables.DARK });
} else {
setContextValue({ ...contextValue, theme: EThemeVariables.LIGHT });
}
};

const langSwitchHandler = (): void => {
if (lang === 'ru') {
setContextValue({ ...contextValue, lang: ELangVariables.EN });
i18n.changeLanguage('en-US');
} else {
setContextValue({ ...contextValue, lang: ELangVariables.RU });
i18n.changeLanguage('ru-RU');
}
};

return (
<StoreContext.Provider value={{ theme, lang, themeSwitchHandler, langSwitchHandler }}>
<Story />
</StoreContext.Provider>
);
}
17 changes: 9 additions & 8 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
const config = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/preset-scss",
"@storybook/addon-mdx-gfm"
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/preset-scss',
'@storybook/addon-mdx-gfm',
'storybook-react-i18next',
],
framework: {
name: "@storybook/react-webpack5",
name: '@storybook/react-webpack5',
options: {},
},
docs: {
autodocs: "tag",
autodocs: 'tag',
},
};
export default config;
8 changes: 6 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import type { Preview } from "@storybook/react";
import type { Preview } from '@storybook/react';
import i18n from '../src/app/i18n/config';
import '!style-loader!css-loader!postcss-loader!tailwindcss/tailwind.css';
import '!style-loader!css-loader!postcss-loader!../src/shared/RangeSlider/RangeSlider.css';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
i18n,
},
};

Expand Down
Loading