Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FJS-4): created new FJS-4 branch and reducer directory #13

Merged
merged 65 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
dc15ec9
feat(FJS-4): created new FJS-4 branch and reducer directory
Evgenie Nov 14, 2021
5b0d5ba
fix(FJS-4): fixed exports, implementation of the useTheme hook in com…
Evgenie Nov 15, 2021
4265b1b
fix(FJS-4): tried to type css objects
Evgenie Nov 17, 2021
4f3cfae
fix(FJS-4): I configure the typing objects with styles.
Evgenie Nov 18, 2021
cd1c756
feat(FJS-4): typed style objects in themes
Evgenie Nov 21, 2021
73988ab
feat(FJS-4): added new components and fixed display of NavBar
Evgenie Nov 21, 2021
9147ba7
fix(FJS-4): fixes in themes
Evgenie Nov 22, 2021
490c140
feat(FJS-4): created typed state-manager Redux
Evgenie Nov 24, 2021
d8f485b
feat(FJS-4): started writing README documentation for BasicButton com…
Evgenie Nov 27, 2021
79f56a5
feat(FJS-4): I made the README.md file of the component button
Evgenie Nov 28, 2021
a5fd90c
fix(FJS-4): moved the table of contents to the top of the document
Evgenie Nov 28, 2021
f24e6da
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
973c0e3
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
d2916c8
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
b69a8a0
feat(FJS-4): I made the README.md file of the component Checkbox
Evgenie Nov 28, 2021
f168df3
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
3244878
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
c59c912
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
9a01fba
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
9a35f04
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
4767c22
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
02a056a
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
1b5f6ee
fix(FJS-4): some fix for displaying README
Evgenie Nov 28, 2021
7c512e2
feat(FJS-4): starting to create animation of menubtn
Evgenie Dec 2, 2021
1e58743
feat(FJS-4): fix animation of menobtn
Evgenie Dec 3, 2021
e65dfe4
feat(FJS-4): Implemented animation of the menubtn
Evgenie Dec 5, 2021
1133ec5
fix(FJS-4): some fix of animation of the menubtn
Evgenie Dec 5, 2021
a9af0ea
fix(FJS-4): some fix of animation of the menubtn
Evgenie Dec 5, 2021
6e058a6
fix(FJS-4): renamed file in theme directory
Evgenie Dec 5, 2021
a67238f
feat(FJS-4): Made README files for Counter and Dropbox components
Evgenie Dec 5, 2021
43837bc
feat(FJS-4): Added the ImageSlides feature and its theme to Gallery …
Evgenie Dec 5, 2021
b777df4
feat(FJS-4): added README file in Image component and started fill RE…
Evgenie Dec 6, 2021
7565fcf
fix(FJS-4): fixed README file in input
Evgenie Dec 13, 2021
132cfbe
fix(FJS-4): fixed README file in input
Evgenie Dec 13, 2021
080aada
fix(FJS-4): fixed README file in input
Evgenie Dec 13, 2021
dfc0daa
fix(FJS-4): fixed README file in input
Evgenie Dec 13, 2021
3a709a8
fix(FJS-4): fixed README file in input
Evgenie Dec 13, 2021
ecf132c
fix(FJS-4): fixed sizeIds types in README files
Evgenie Dec 13, 2021
6988826
feat(FJS-4): made README file in the first input component
Evgenie Dec 13, 2021
c56c994
feat(FJS-4): upgraded yarn
Evgenie Dec 13, 2021
8871a50
feat(FJS-4): made README file in Input4Search component
Evgenie Dec 13, 2021
2e9953c
fix(FJS-4): fixed README file in input
Evgenie Dec 13, 2021
893b8a1
feat(FJS-4): made README file in InputWithMask component
Evgenie Dec 13, 2021
8bb40c6
fix(FJS-4): renamed TCSSObjProps file
Evgenie Dec 14, 2021
020b689
fix(FJS-4): a little fix in InputWithMask
Evgenie Dec 14, 2021
f64dfb7
featFJS-4): made README file in Label component
Evgenie Dec 14, 2021
1565b2c
fix(FJS-4): a little fix in Inputs
Evgenie Dec 14, 2021
fb9ec94
fix(FJS-4): a little fix in Input
Evgenie Dec 14, 2021
365b000
fix(FJS-4): a little fix in Input
Evgenie Dec 14, 2021
c35418c
fix(FJS-4): a little fix in InputBox
Evgenie Dec 15, 2021
d1ce326
fix(FJS-4): a little fix in Input
Evgenie Dec 15, 2021
0ed4b60
featFJS-4): made README file in Logo component
Evgenie Dec 15, 2021
974e8b1
featFJS-4): made README file in MiniCard component
Evgenie Dec 15, 2021
cb46c16
feat(FJS-3): started to create README file for component Modal
Evgenie Jan 10, 2022
955af7b
feat(FJS-4): Started create ImageSlides component
Evgenie Jan 11, 2022
f873c6f
feat(FJS-4): some changes in ImageSlides
Evgenie Jan 12, 2022
9c08f35
feat(FJS-4): some changes in ImageSlides
Evgenie Jan 13, 2022
b0b1e0d
feat(FJS-4): made ImageSlider component
Evgenie Jan 15, 2022
c7f4802
feat(FJS-4):
Evgenie Jan 15, 2022
69b84de
feat(FJS-4): realized animation of nav elements of ImageSlider component
Evgenie Jan 15, 2022
b2ffa2a
fixed(FJS-4): some fix
Evgenie Jan 15, 2022
08b4511
fixed(FJS-4): some fix
Evgenie Jan 15, 2022
5ad6c3e
fix(FJS-4): some fixes in ImageSlider component
Evgenie Jan 17, 2022
02a7032
fix(FJS-4): fixed ImageSlider
Evgenie Jan 18, 2022
f217efb
fix(FJS-4): some fix in ImageSlider
Evgenie Jan 20, 2022
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
Prev Previous commit
Next Next commit
feat(FJS-4): created typed state-manager Redux
  • Loading branch information
Evgenie committed Nov 24, 2021
commit 490c140aecfa6261de634f347c8f0c48173587d2
7 changes: 5 additions & 2 deletions examples/react-uikit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
"@rematch/core": "^2.1.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.11",
"@types/react-redux": "^7.1.20",
"@types/react-router-dom": "^5.3.2",
"axios": "^0.21.1",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-redux": "^7.2.6",
"react-router-dom": "^5.2.1",
"react-scripts": "4.0.3",
"redux": "^4.1.1",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.4.0",
"web-vitals": "^2.1.0"
},
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions examples/react-uikit/src/assets/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { useTypedSelector } from './useTypedSelector';
export { useActions } from './useActions';
8 changes: 8 additions & 0 deletions examples/react-uikit/src/assets/hooks/useActions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { useDispatch } from "react-redux";
import { bindActionCreators } from "redux";
import * as ActionCreators from '../../store/ActionCreators'

export const useActions = ()=>{
const dispatch = useDispatch();
return bindActionCreators(ActionCreators, dispatch);
};
4 changes: 4 additions & 0 deletions examples/react-uikit/src/assets/hooks/useTypedSelector.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { TypedUseSelectorHook, useSelector } from "react-redux";
import { TRootState } from "../../store/reducers/rootReducer";

export const useTypedSelector: TypedUseSelectorHook<TRootState> = useSelector;
10 changes: 2 additions & 8 deletions examples/react-uikit/src/definitions/TCSSobjProps.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import { StandardProperties } from "csstype";
import { CSSObject } from "@emotion/react";
import { TSize } from "./TElementProps";

export type TSectionName = 'core' | TSize;

export type NestedSelector = {
[index: string]: StandardProperties | NestedSelector;
}

export type Properties = StandardProperties | NestedSelector;

export type TCSSObjProps = {
[key in TSectionName]: Properties;
[key in TSectionName]: CSSObject;
};

export default TCSSObjProps;
20 changes: 20 additions & 0 deletions examples/react-uikit/src/definitions/TNavbarVisibilityReducer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export interface INavbarVisibility {
visibility: boolean,
}

export enum TVisibilityActions {
HIDE_NAVBAR = 'HIDE_NAVBAR',
DISPLAY_NAVBAR = 'DISPLAY_NAVBAR',
}

interface IHideNavbarAction {
type: TVisibilityActions.HIDE_NAVBAR,
visibility: false,
}

interface IDisplayNavbarAction {
type: TVisibilityActions.DISPLAY_NAVBAR,
visibility: true,
}

export type TNavbarActions = IHideNavbarAction | IDisplayNavbarAction;
4 changes: 3 additions & 1 deletion examples/react-uikit/src/definitions/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type { TElementProps } from "./TElementProps";

export type { TCSSObjProps } from './TCSSobjProps'
export type { TCSSObjProps } from './TCSSobjProps';

export * from './TNavbarVisibilityReducer'
6 changes: 4 additions & 2 deletions examples/react-uikit/src/epics/About/About.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useTheme } from '@emotion/react';
import React from 'react'
import React, { MouseEventHandler } from 'react'
import { TElementProps } from '../../definitions';
import { CWrap } from './About.styles';

export type IProps = TElementProps;
export type IProps = TElementProps & {
onClick?: MouseEventHandler,
};

export const About: React.FC<IProps> = (props): JSX.Element => {
//@ts-ignore
Expand Down
15 changes: 13 additions & 2 deletions examples/react-uikit/src/epics/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useTheme } from '@emotion/react';
import React from 'react';
import { useTypedSelector } from '../../assets/hooks';
import { useActions } from '../../assets/hooks/';
import { TElementProps } from '../../definitions';
import Footer from '../../features/Footer';
import Header from '../../features/Header';
Expand All @@ -9,12 +11,21 @@ import { CWrap } from './App.styles';
export type IProps = TElementProps;

export const App: React.FC<IProps> = (props): JSX.Element => {
const navbarVisibility = useTypedSelector(state => state.navbarVisibility);
const { hideNavbar } = useActions();

//@ts-ignore
const theme = { ...useTheme().App };
return (
<CWrap sizeId={'desktop'} theme={theme.cwrap}>
<CWrap
sizeId={'desktop'}
theme={theme.cwrap}
onClick={(e) => { navbarVisibility.visibility && hideNavbar() }}
>
<Header sizeId={'desktop'} />
<AppRouter sizeId={'desktop'} />
<AppRouter
sizeId={'desktop'}
/>
<Footer sizeId={'desktop'} />
</CWrap>
);
Expand Down
6 changes: 4 additions & 2 deletions examples/react-uikit/src/epics/Contacts/Contacts.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useTheme } from '@emotion/react';
import React from 'react'
import React, { MouseEventHandler } from 'react'
import { TElementProps } from '../../definitions';
import { CWrap } from './Contacts.styles'

export type IProps = TElementProps;
export type IProps = TElementProps & {
onClick?: MouseEventHandler,
};

export const Contacts: React.FC<IProps> = (): JSX.Element => {
//@ts-ignore
Expand Down
6 changes: 4 additions & 2 deletions examples/react-uikit/src/epics/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useTheme } from '@emotion/react';
import React from 'react'
import React, { MouseEventHandler } from 'react'
import { TElementProps } from '../../definitions';
import { CWrap } from './FAQ.styles';

export type IProps = TElementProps;
export type IProps = TElementProps & {
onClick?: MouseEventHandler,
};
export const FAQ: React.FC<IProps> = (props): JSX.Element => {
//@ts-ignore
const theme = {...useTheme().FAQ};
Expand Down
6 changes: 4 additions & 2 deletions examples/react-uikit/src/epics/Gallery/Gallery.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useTheme } from '@emotion/react';
import React from 'react'
import React, { MouseEventHandler } from 'react'
import { TElementProps } from '../../definitions';
import { CWrap } from './Gallery.styles';

export type IProps = TElementProps;
export type IProps = TElementProps & {
onClick?: MouseEventHandler,
};

export const Gallery: React.FC<IProps> = (props): JSX.Element => {
//@ts-ignore
Expand Down
6 changes: 4 additions & 2 deletions examples/react-uikit/src/epics/Promo/Promo.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { useTheme } from '@emotion/react';
import React from 'react'
import React, { MouseEventHandler } from 'react'
import { TElementProps } from '../../definitions';
import { CWrap } from './Promo.styles';


export type IProps = TElementProps;
export type IProps = TElementProps & {
onClick?: MouseEventHandler,
};

export const Promo: React.FC<IProps> = (props): JSX.Element => {
//@ts-ignore
Expand Down
6 changes: 4 additions & 2 deletions examples/react-uikit/src/epics/Welcome/Welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { useTheme } from '@emotion/react';
import React from 'react';
import React, { MouseEventHandler } from 'react';
import { TElementProps } from '../../definitions';
import Section from '../../features/Section';
import { CWrap } from './Welcome.styles';

export type IProps = TElementProps;
export type IProps = TElementProps & {
onClick?: MouseEventHandler,
};

export const Welcome: React.FC<IProps> = (props): JSX.Element => {
//@ts-ignore
Expand Down
7 changes: 1 addition & 6 deletions examples/react-uikit/src/features/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTheme } from '@emotion/react';
import React, { MouseEventHandler, useState } from 'react';
import React, { MouseEventHandler } from 'react';
import { Link } from 'react-router-dom';
import { TElementProps } from '../../definitions';
import MenuBtn from '../MenuBtn';
Expand All @@ -11,7 +11,6 @@ export type IProps = TElementProps & {
};

export const Header: React.FC<IProps> = (props): JSX.Element => {
const [navBarVisibility, setNavBarVisibility] = useState(false);
//@ts-ignore
const theme = { ...useTheme().Header };

Expand All @@ -21,13 +20,9 @@ export const Header: React.FC<IProps> = (props): JSX.Element => {
<MenuWrap sizeId={'desktop'} theme={theme.menuwrap} >
<MenuBtn
sizeId={'desktop'}
setNavBarVisibility={setNavBarVisibility}
navBarVisibility={navBarVisibility}
/>
<NavBar
sizeId={'desktop'}
visibility={navBarVisibility}
onClick={(e) => e.stopPropagation()}
/>
</MenuWrap>

Expand Down
25 changes: 16 additions & 9 deletions examples/react-uikit/src/features/MenuBtn/MenuBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import { useTheme } from '@emotion/react'
import React from 'react'
import React, { MouseEventHandler } from 'react'
import { useTypedSelector } from '../../assets/hooks';
import { useActions } from '../../assets/hooks/useActions';
import { TElementProps } from '../../definitions';
import { CWrap, Line } from './MenuBtn.styles'

export type IProps = TElementProps & React.HTMLAttributes<HTMLDivElement> & {
setNavBarVisibility: any;
navBarVisibility: boolean;
onClick?: MouseEventHandler;
onMouseOver?: MouseEventHandler;
};

export const MenuBtn: React.FC<IProps> = (props): JSX.Element => {
const {navBarVisibility, setNavBarVisibility} = props;
const navbarVisibility = useTypedSelector(state => state.navbarVisibility);
const { hideNavbar, displayNavbar } = useActions();

const setNavbarVisibility = (visibility: boolean) => {
visibility ? hideNavbar() : displayNavbar();
};
//@ts-ignore
const theme = {...useTheme().MenuBtn};
const theme = { ...useTheme().MenuBtn };
return (
<CWrap sizeId={'desktop'} theme={theme.cwrap} onClick={()=>{setNavBarVisibility(!navBarVisibility)}}>
<Line sizeId={'desktop'} theme={theme.line}/>
<Line sizeId={'desktop'} theme={theme.line}/>
<Line sizeId={'desktop'} theme={theme.line}/>
<CWrap sizeId={'desktop'} theme={theme.cwrap} onClick={()=>setNavbarVisibility(navbarVisibility.visibility)} >
<Line sizeId={'desktop'} theme={theme.line} />
<Line sizeId={'desktop'} theme={theme.line} />
<Line sizeId={'desktop'} theme={theme.line} />
</CWrap>
)
}
Expand Down
50 changes: 38 additions & 12 deletions examples/react-uikit/src/features/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,55 @@
import { useTheme } from '@emotion/react';
import React, { MouseEventHandler } from 'react';
import { Link } from 'react-router-dom';
import { useTypedSelector } from '../../assets/hooks';
import { TElementProps } from '../../definitions';
import { CWrap, Line } from './NavBar.styles';

export type IProps = TElementProps & {
visibility: boolean;
onClick?: MouseEventHandler;
};

export const NavBar: React.FC<IProps> = (props): JSX.Element => {
const visibility = props.visibility;
const navbarVisibility = useTypedSelector(state => state.navbarVisibility);

//@ts-ignore
const theme = { ...useTheme().NavBar };
return (
<CWrap sizeId={'desktop'} theme={visibility ? theme.cwrap : theme.hidden }>
<Link to={'/about'}>About us</Link>
<Line sizeId={'desktop'} theme={theme.line} />
<Link to={'/gallery'}>Gallery</Link>
<Line sizeId={'desktop'} theme={theme.line} />
<Link to={'/promo'}>Promo</Link>
<Line sizeId={'desktop'} theme={theme.line} />
<Link to={'/contacts'}>Contacts</Link>
<Line sizeId={'desktop'} theme={theme.line} />
<Link to={'/faq'}>FAQ</Link>
<CWrap
sizeId={'desktop'}
onClick={(e) => e.stopPropagation()}
theme={navbarVisibility.visibility ? theme.cwrap : theme.hidden}
>
<Link to={'/about'}>
About us
</Link>
<Line
sizeId={'desktop'}
theme={theme.line}
/>
<Link to={'/gallery'}>
Gallery
</Link>
<Line
sizeId={'desktop'}
theme={theme.line}
/>
<Link to={'/promo'}>
Promo
</Link>
<Line
sizeId={'desktop'}
theme={theme.line} />
<Link to={'/contacts'}>
Contacts
</Link>
<Line
sizeId={'desktop'}
theme={theme.line}
/>
<Link to={'/faq'}>
FAQ
</Link>
</CWrap>
)
};
Expand Down
16 changes: 10 additions & 6 deletions examples/react-uikit/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { css, Global, ThemeProvider } from '@emotion/react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import resets from './assets';
import App from './epics/App/index';
import reportWebVitals from './reportWebVitals';
import { store } from './store';
import theme from './theme';

ReactDOM.render(
<BrowserRouter>
<ThemeProvider theme={theme}>
<App sizeId={'desktop'} />
<Global styles={resets || css``} />
</ThemeProvider>
</BrowserRouter>,
<Provider store={store}>
<BrowserRouter>
<ThemeProvider theme={theme}>
<App sizeId={'desktop'} />
<Global styles={resets || css``} />
</ThemeProvider>
</BrowserRouter>
</Provider>,
document.getElementById('root')
);

Expand Down
6 changes: 4 additions & 2 deletions examples/react-uikit/src/routes/AppRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { MouseEventHandler } from 'react';
import { Route, Switch } from 'react-router-dom';
import { TElementProps } from '../definitions';
import About from '../epics/About';
Expand All @@ -8,7 +8,9 @@ import Gallery from '../epics/Gallery';
import Promo from '../epics/Promo';
import Welcome from '../epics/Welcome';

export type IProps = TElementProps;
export type IProps = TElementProps & {
onClick?: MouseEventHandler,
};

export const AppRouter: React.FC<IProps> = (props): JSX.Element => {
return (
Expand Down
1 change: 1 addition & 0 deletions examples/react-uikit/src/store/ActionCreators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './navbarVisibility';
Loading