Skip to content

Commit 03c5d74

Browse files
committed
ui: Added global styles to customize rc-select dropdown menus
1 parent b2f2a09 commit 03c5d74

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

app/src/components/layout/Layout.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { observer } from 'mobx-react-lite';
3+
import { Global, Theme } from '@emotion/react';
34
import styled from '@emotion/styled';
45
import { useStore } from 'store';
56
import { Background, Menu } from 'components/base';
@@ -10,6 +11,47 @@ interface CollapsedProps {
1011
fullWidth?: boolean;
1112
}
1213

14+
const GlobalStyles = (theme: Theme) => `
15+
.rc-select-dropdown {
16+
padding-top: 10px;
17+
background-color: transparent;
18+
19+
& > div {
20+
color: ${theme.colors.offWhite};
21+
background-color: ${theme.colors.lightBlue};
22+
border-width: 0;
23+
border-radius: 8px;
24+
box-shadow: 0px 16px 16px rgba(0, 0, 0, 0.15);
25+
overflow: hidden;
26+
}
27+
}
28+
29+
.rc-select-item {
30+
color: ${theme.colors.white};
31+
font-family: ${theme.fonts.open.regular};
32+
font-weight: 600;
33+
font-size: ${theme.sizes.s};
34+
line-height: 24px;
35+
padding: 16px;
36+
border-bottom: 1px solid ${theme.colors.paleBlue};
37+
38+
&:last-of-type {
39+
border-bottom: none;
40+
}
41+
42+
&:hover {
43+
color: ${theme.colors.white};
44+
background-color: ${theme.colors.blue};
45+
cursor: pointer;
46+
}
47+
48+
& > .rc-select-item-option-state {
49+
top: 16px;
50+
right: 12px;
51+
}
52+
}
53+
`;
54+
1355
const Styled = {
1456
Container: styled.div<{ fullWidth: boolean }>`
1557
position: relative;
@@ -86,6 +128,7 @@ export const Layout: React.FC = ({ children }) => {
86128
<Fluid className="container-fluid">{children}</Fluid>
87129
</Content>
88130
</Container>
131+
<Global styles={GlobalStyles} />
89132
</Background>
90133
);
91134
};

app/src/components/theme.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const theme: Theme = {
4242
purple: '#57038d',
4343
overlay: 'rgba(245,245,245,0.04)',
4444
gradient: 'linear-gradient(325.53deg, #252F4A 0%, #46547B 100%);',
45+
lightBlue: '#384770',
46+
paleBlue: '#2E3A5C',
4547
},
4648
};
4749

app/src/emotion-theme.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ declare module '@emotion/react' {
3838
purple: string;
3939
overlay: string;
4040
gradient: string;
41+
lightBlue: string;
42+
paleBlue: string;
4143
};
4244
}
4345
}

0 commit comments

Comments
 (0)