Skip to content

Commit 4eff2c2

Browse files
Code Refactoring (#372)
* Removed unnecessary scripts * Updated code structure
1 parent 1ad3d42 commit 4eff2c2

File tree

22 files changed

+213
-208
lines changed

22 files changed

+213
-208
lines changed

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"scripts": {
3131
"lint": "eslint --ext js,ts,tsx src --fix",
3232
"run-cypress": "npx cypress run",
33-
"start-devnet": "npm run copy-devnet-config & vite dev --force",
33+
"start-devnet": "npm run copy-devnet-config & vite dev",
3434
"start-testnet": "npm run copy-testnet-config & vite dev",
3535
"start-mainnet": "npm run copy-mainnet-config & vite dev",
3636
"build-devnet": "tsc & npm run copy-devnet-config & vite build",
@@ -39,10 +39,7 @@
3939
"copy-devnet-config": "cp ./src/config/config.devnet.ts ./src/config/index.ts",
4040
"copy-testnet-config": "cp ./src/config/config.testnet.ts ./src/config/index.ts",
4141
"copy-mainnet-config": "cp ./src/config/config.mainnet.ts ./src/config/index.ts",
42-
"test": "jest",
43-
"wdio-smoke": "wdio run wdio/wdio.conf.ts",
44-
"smoke": "wdio run wdio/wdio.conf.ts --suite smoke",
45-
"install-verdaccio": "pnpm remove @multiversx/sdk-dapp && pnpm install @multiversx/sdk-dapp@latest --registry http://localhost:4873"
42+
"test": "jest"
4643
},
4744
"browserslist": [
4845
">0.2%",

src/components/AddressComponent/AddressComponent.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313

1414
// prettier-ignore
1515
const styles = {
16+
addressComponent: 'address-component flex overflow-hidden flex-1 w-full',
1617
addressContainer: 'address-container text-primary transition-all duration-200 ease-out font-normal text-xs xs:text-sm pt-1 lg:pt-0 overflow-auto',
1718
address: 'address break-words lg:break-normal',
1819
trimmedAddress: 'trimmed-address !w-max',
@@ -40,7 +41,7 @@ export const AddressComponent = ({
4041
});
4142

4243
return (
43-
<>
44+
<div className={styles.addressComponent}>
4445
<p className={styles.addressContainer}>
4546
{isHeader ? (
4647
<MvxTrim text={address} className={styles.trimmedAddress} />
@@ -68,6 +69,6 @@ export const AddressComponent = ({
6869
<FontAwesomeIcon icon={faArrowUpRightFromSquare} />
6970
</a>
7071
</div>
71-
</>
72+
</div>
7273
);
7374
};

src/components/Drawer/Drawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Sheet } from 'react-modal-sheet';
44

55
import { WithClassnameType } from 'types';
66

7-
import { styles } from './drawer.styles';
7+
import styles from './drawer.styles';
88

99
interface DrawerPropsType extends PropsWithChildren, WithClassnameType {
1010
isOpen: boolean;

src/components/Drawer/drawer.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// prettier-ignore
2-
export const styles = {
2+
export default {
33
drawer: 'drawer flex',
44
drawerBackdrop: 'drawer-backdrop bg-primary! transition-opacity duration-200 fixed inset-0 opacity-0 pointer-events-none z-40 ease-in-out md:hidden',
55
drawerBackdropVisible: 'opacity-90 pointer-events-auto!',

src/components/Header/Header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
import { RouteNamesEnum } from 'localConstants';
2626

2727
import { ThemeTooltip } from './components';
28-
import { styles } from './header.styles';
28+
import styles from './header.styles';
2929

3030
interface HeaderBrowseButtonType {
3131
handleClick: (event: MouseEvent<HTMLDivElement>) => void;
@@ -154,7 +154,7 @@ export const Header = () => {
154154
</Tooltip>
155155
</div>
156156
) : (
157-
<>
157+
<div className={styles.headerNavigationConnect}>
158158
<MvxButton
159159
onClick={handleLogIn}
160160
className={styles.headerNavigationConnectDesktop}
@@ -171,7 +171,7 @@ export const Header = () => {
171171
className={styles.headerNavigationConnectIcon}
172172
/>
173173
</div>
174-
</>
174+
</div>
175175
)}
176176
</nav>
177177
</header>

src/components/Header/components/ThemeTooltip/ThemeTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from 'hooks/useHandleThemeManagement';
1313

1414
import { ThemeTooltipDots } from './components';
15-
import { styles } from './themeTooltip.styles';
15+
import styles from './themeTooltip.styles';
1616

1717
interface ThemeTooltipOptionType extends ThemeOptionType {
1818
dotColors: string[];

src/components/Header/components/ThemeTooltip/themeTooltip.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// prettier-ignore
2-
export const styles = {
2+
export default {
33
themeTooltip: 'theme-tooltip',
44
themeTooltipTrigger: 'theme-tooltip-trigger flex h-8 lg:h-10 cursor-pointer gap-1 lg:gap-2 items-center justify-center w-12 min-w-12 max-w-12 lg:min-w-16 lg:max-w-16 lg:w-16 relative after:absolute after:bg-btn-variant after:left-0 after:right-0 after:top-0 after:bottom-0 after:pointer-events-none after:rounded-xl after:duration-200 after:ease-out after:transition-all hover:after:opacity-100',
55
themeTooltipTriggerToggled: 'after:opacity-100',

src/components/Header/header.styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// prettier-ignore
2-
export const styles = {
2+
export default {
33
header: 'header flex items-center justify-between px-4 h-16 md:h-20 md:px-10',
44
headerLogo: 'header-logo transition-opacity duration-200',
55
headerNavigation: 'header-navigation flex items-center gap-2 lg:gap-4',
@@ -9,6 +9,7 @@ export const styles = {
99
headerNavigationTooltip: 'header-navigation-tooltip p-1 leading-none whitespace-nowrap text-tertiary',
1010
headerNavigationNetwork: 'header-navigation-network h-8 border border-secondary rounded-xl lg:h-10 relative w-22 flex items-center justify-center leading-none capitalize text-tertiary before:absolute before:rounded-full before:w-2 before:lg:w-2.5 before:h-2 before:lg:h-2.5 before:bg-btn-primary before:z-2 before:-top-0.25 before:lg:-top-0.5 before:-left-0.25 before:lg:-left-0.5 after:absolute after:bg-primary after:rounded-lg after:opacity-40 after:left-0 after:right-0 after:top-0 after:bottom-0 after:pointer-events-none',
1111
headerNavigationNetworkLabel: 'header-navigation-network-label relative z-1',
12+
headerNavigationConnect: 'header-navigation-connect',
1213
headerNavigationConnectDesktop: 'header-navigation-connect-desktop h-8 lg:h-10 hidden sm:block!',
1314
headerNavigationConnectMobile: 'header-navigation-connect-mobile w-8 h-8 bg-btn-tertiary cursor-pointer flex justify-center items-center sm:hidden text-xs rounded-xl',
1415
headerNavigationConnectIcon: 'header-navigation-connect-icon text-accent',

src/pages/Dashboard/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
SignMessage,
1515
Transactions
1616
} from './widgets';
17-
import { styles } from './dashboard.styles';
17+
import styles from './dashboard.styles';
1818

1919
const dashboardWidgets: WidgetType[] = [
2020
{

src/pages/Dashboard/components/LeftPanel/LeftPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { getAccountProvider, useGetAccountInfo, useGetIsLoggedIn } from 'lib';
1313
import { RouteNamesEnum } from 'localConstants';
1414

1515
import { Account, SideMenu } from './components';
16-
import { styles } from './leftPanel.styles';
16+
import styles from './leftPanel.styles';
1717

1818
interface LeftPanelPropsType {
1919
isOpen: boolean;

0 commit comments

Comments
 (0)