Skip to content

Commit

Permalink
Merge pull request #477 from sirraminyavari/dev-redesign
Browse files Browse the repository at this point in the history
feat(re-design): ✨ update redisign
  • Loading branch information
sorenabedi committed May 31, 2023
2 parents 941b885 + 2551fdb commit 5c02af9
Show file tree
Hide file tree
Showing 34 changed files with 240 additions and 373 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@atlaskit/tree": "^8.6.0",
"@cliqmind/react-table": "^7.8.0-dev.1",
"@cliqmind/rv-components": "^0.4.1-dev",
"@cliqmind/rv-components": "^0.4.1-dev-1",
"@draft-js-plugins/editor": "^4.1.0",
"@draft-js-plugins/mention": "^4.5.1",
"@lottiefiles/react-lottie-player": "^3.4.1",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
</script>
<title>Raaivan</title>
</head>
<body class="Direction TextAlign default" style="font-size: unset !important">
<body class="Direction TextAlign" style="font-size: unset !important">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div id="block-editor-portal"></div>
Expand Down
39 changes: 21 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CV_WHITE } from 'constant/CssVariables';
import { avatarIconURL } from 'helpers/helpers';
import consoleLogger from 'utils/console/consoleLogger';
import 'scss/global.scss';
import ThemeProvider from 'components/ThemeProvider/ThemeProvider';

const { RV_RTL, GlobalUtilities } = window;

Expand Down Expand Up @@ -44,24 +45,26 @@ const App = () => {
bodyClassName="rv-font-default"
/>
<StoreProvider>
<Suspense fallback={<LogoLoader />}>
<Router>
<ScrollToTop />
<Switch>
<Route
path={AUTH_PATH}
render={(props) => (
<CheckRoute
props={props}
name={LOGIN_NAME}
component={AuthView}
/>
)}
/>
<PrivateRoute path={ROOT_PATH} component={MainLayout} />
</Switch>
</Router>
</Suspense>
<ThemeProvider>
<Suspense fallback={<LogoLoader />}>
<Router>
<ScrollToTop />
<Switch>
<Route
path={AUTH_PATH}
render={(props) => (
<CheckRoute
props={props}
name={LOGIN_NAME}
component={AuthView}
/>
)}
/>
<PrivateRoute path={ROOT_PATH} component={MainLayout} />
</Switch>
</Router>
</Suspense>
</ThemeProvider>
</StoreProvider>
</ErrorBoundry>
);
Expand Down
55 changes: 0 additions & 55 deletions src/components/Buttons/Toggle/Toggle.js

This file was deleted.

97 changes: 0 additions & 97 deletions src/components/Buttons/Toggle/Toggle.styles.js

This file was deleted.

26 changes: 26 additions & 0 deletions src/components/Buttons/Toggle/Toggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Renders a toggle button.
*/
import { RVSwitch, Switch } from '@cliqmind/rv-components';

/**
* @description Renders a Toggle component.
* @component
*/
const ToggleButton = ({ children, disabled, title, ...rest }: RVSwitch) => {
return (
<>
<Switch label={title} disabled={disabled} {...rest} />
{children}
</>
);
};

ToggleButton.defaultProps = {
value: false,
disabled: false,
};

ToggleButton.displayName = 'ToggleButtonComponent';

export default ToggleButton;
2 changes: 1 addition & 1 deletion src/components/ItemSelection/items/SideItemSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import DimensionHelper from 'utils/DimensionHelper/DimensionHelper';
import ClassItem from './ClassItem';
import ScrollBarProvider from 'components/ScrollBarProvider/ScrollBarProvider';
import { decodeBase64 } from 'helpers/helpers';
import Toggle from 'components/Toggle/Toggle';
import Toggle from 'components/Buttons/Toggle/Toggle';

const { RV_RTL, RVDic } = window || {};

Expand Down
9 changes: 4 additions & 5 deletions src/components/Modal/Messages/DeleteConfirmMessage.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { TC_DEFAULT } from 'constant/Colors';
import { CV_GRAY_DARK, CV_RED } from 'constant/CssVariables';
import { CV_GRAY_DARK, CV_RED, TCV_DEFAULT } from 'constant/CssVariables';
import { RVColorProp } from '@cliqmind/rv-components';

/**
*
Expand All @@ -19,10 +19,9 @@ import { CV_GRAY_DARK, CV_RED } from 'constant/CssVariables';
const DeleteConfirmMSG = ({ title, Icon, question, warning }) => {
return (
<>
<TextContainer bottomMargin="1.8rem">
<TextContainer bottomMargin="1.8rem" className={RVColorProp.distant}>
<Icon
className={TC_DEFAULT}
style={{ marginInlineEnd: '0.3rem' }}
style={{ marginInlineEnd: '0.3rem', color: TCV_DEFAULT }}
size="1.2rem"
/>
{title}
Expand Down
7 changes: 5 additions & 2 deletions src/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styled from 'styled-components';
import usePrevious from 'hooks/usePrevious';
import useWindow from 'hooks/useWindowContext';
import CloseButton from 'components/Buttons/CloseButton';
import { RVColorProp } from '@cliqmind/rv-components';

const Modal = ({
title,
Expand Down Expand Up @@ -84,7 +85,9 @@ const Modal = ({
>
{!stick && <EmptyTitleSide />}
<TitleArea
className={`${titleClass ? titleClass : 'WarmColor'}`}
className={`${
titleClass ? titleClass : RVColorProp.distant
}`}
>
{title}
</TitleArea>
Expand Down Expand Up @@ -165,7 +168,7 @@ const TitleArea = styled.div`
font-weight: 600;
font-size: 0.9rem;
text-align: center;
color:
&:first-letter {
text-transform: uppercase;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/PeoplePicker/PeoplePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UndoIcon from 'components/Icons/UndoIcon/Undo';
import LogoLoader from 'components/Loaders/LogoLoader/LogoLoader';
import ScrollBarProvider from 'components/ScrollBarProvider/ScrollBarProvider';
import SimpleListViewer from 'components/SimpleListViewer/SimpleListViewer';
import Toggle from 'components/Toggle/Toggle';
import Toggle from 'components/Buttons/Toggle/Toggle';
import { C_DISTANT } from 'constant/Colors';
import { CV_DISTANT, CV_FREEZED, CV_RED } from 'constant/CssVariables';
import { decodeBase64, encodeBase64 } from 'helpers/helpers';
Expand Down
31 changes: 31 additions & 0 deletions src/components/ThemeProvider/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { WindowContext } from 'context/WindowProvider';
import useWindowContext from 'hooks/useWindowContext';
import { PropsWithChildren, useEffect } from 'react';
import { useSelector } from 'react-redux';
import { selectTheme } from 'store/slice/theme/selectors';

const ThemeProvider = ({ children }: PropsWithChildren<void>) => {
const { RV_RTL } = useWindowContext();
const themeState = useSelector(selectTheme);
useEffect(() => {
const directionState = RV_RTL ? 'direction-rtl' : 'direction-ltr';

document.body.setAttribute('dir', RV_RTL ? 'rtl' : 'ltr');

if (themeState.currentTheme)
document.documentElement.className = [
themeState.currentTheme,
'overflow-enabled',
directionState,
].join(' ');
else
document.documentElement.className = [
'default',
'overflow-enabled',
directionState,
].join(' ');
}, [themeState.currentTheme, RV_RTL]);
return <>{children}</>;
};

export default ThemeProvider;
Loading

0 comments on commit 5c02af9

Please sign in to comment.