Skip to content

Commit 2aa9b6a

Browse files
committed
ui updates
1 parent c1024cc commit 2aa9b6a

File tree

22 files changed

+288
-295
lines changed

22 files changed

+288
-295
lines changed

src/ui/assets/cookie.svg

Lines changed: 9 additions & 0 deletions
Loading

src/ui/assets/logo_small.svg

Lines changed: 3 additions & 0 deletions
Loading

src/ui/components/logos/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ import { Image } from '..';
44

55
import logo from '../../assets/logo.svg';
66
import logoWhite from '../../assets/logo_white.svg';
7+
import logoSmallWhite from '../../assets/logo_small.svg';
78

89
export const ZenMLLogo: React.FC = () => (
910
<Image style={{ width: 113, height: 32 }} src={logo} />
1011
);
1112

1213
export const ZenMLLogoWhite: React.FC = () => (
1314
<Image style={{ width: 150, height: 35 }} src={logoWhite} />
15+
);
16+
17+
export const ZenMLLogoSmall: React.FC = () => (
18+
<Image style={{ width: 36, height: 36 }} src={logoSmallWhite} />
1419
);

src/ui/components/typographies/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
.baseParagraph {
3333
font-family: $fontFamilyNormal;
34-
color: $textColor;
34+
color: #828282;
3535
word-wrap: break-word;
3636
margin: 0;
3737
}

src/ui/layouts/common/Table/index.module.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,21 @@
3636

3737
.tableHeaderRow {
3838
border-top: 1px solid $lightestGreyColor;
39-
background-color: $lightestGreyColor ;
39+
background-color: #D9D9D9 !important;
4040
}
4141

4242
.tableHeadingTh {
4343
text-align: left;
4444
vertical-align: middle;
45-
45+
color: #424240 !important;
46+
font-size: 14px !important;
47+
font-weight: 400
4648
}
4749

4850

4951
.tableTd {
5052
vertical-align: middle;
53+
height: 53px !important
5154
}
5255

5356
.lastTable tbody tr:last-child {

src/ui/layouts/common/Table/index.tsx

Lines changed: 94 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,91 @@ export const Table: React.FC<TableProps> = ({
4747
renderAfterRow,
4848
trOnClick,
4949
}) => {
50+
51+
// const [tableHeight, setTableHeight] = useState("auto");
52+
// const [activeIndex, setActiveIndex] = useState(null);
53+
// const tableElement = useRef(null);
54+
// const createHeaders = (headers: any) => {
55+
// return headerCols?.map((item: any) => ({
56+
// text: item,
57+
// ref: tableElement
58+
// }));
59+
// };
60+
61+
// const columns = createHeaders(headerCols?.length);
62+
63+
// const minCellWidth = 120
64+
65+
// useEffect(() => {
66+
// // @ts-ignore
67+
// // console.log(tableElement && tableElement.current.offsetHeight);
68+
// setTableHeight(tableElement?.current?.offsetHeight);
69+
// }, []);
70+
71+
// const mouseDown = (index: any) => {
72+
// setActiveIndex(index);
73+
// };
74+
75+
76+
// const mouseMove = useCallback(
77+
// (e) => {
78+
// const gridColumns = columns.map((col: any, i: any) => {
79+
// if (i === activeIndex) {
80+
// const width = e.clientX - col.ref.current.offsetLeft;
81+
82+
// if (width >= minCellWidth) {
83+
// return `${width}px`;
84+
// }
85+
// }
86+
// return `${col.ref.current.offsetWidth}px`;
87+
// });
88+
89+
// // @ts-ignore
90+
// tableElement.current.style.gridTemplateColumns = `${gridColumns.join(
91+
// " "
92+
// )}`;
93+
// },
94+
// [activeIndex, columns, minCellWidth]
95+
// );
96+
97+
// const removeListeners = useCallback(() => {
98+
// window.removeEventListener("mousemove", mouseMove);
99+
// window.removeEventListener("mouseup", removeListeners);
100+
// }, [mouseMove]);
101+
102+
// const mouseUp = useCallback(() => {
103+
// setActiveIndex(null);
104+
// removeListeners();
105+
// }, [setActiveIndex, removeListeners]);
106+
107+
// useEffect(() => {
108+
// if (activeIndex !== null) {
109+
// window.addEventListener("mousemove", mouseMove);
110+
// window.addEventListener("mouseup", mouseUp);
111+
// }
112+
113+
// return () => {
114+
// removeListeners();
115+
// };
116+
// }, [activeIndex, mouseMove, mouseUp, removeListeners]);
117+
118+
// // Demo only
119+
// const resetTableCells = () => {
120+
// // @ts-ignore
121+
// tableElement.current.style.gridTemplateColumns = "";
122+
// };
123+
124+
125+
126+
127+
128+
129+
130+
131+
132+
133+
134+
50135
const { pageIndex, setPageIndex } = usePaginationAsQueryParam();
51136

52137
const { itemsForPage, pages, totalOfPages } = getPaginationData({
@@ -64,31 +149,28 @@ export const Table: React.FC<TableProps> = ({
64149
if (loading) {
65150
return <FullWidthSpinner color="black" size="md" />;
66151
}
67-
68-
152+
69153
return (
70154
<FlexBox.Column className={styles.tableWrapper} fullWidth>
71155
<IfElse
72156
condition={tableRows.length > 0 && !loading}
73157
renderWhenTrue={() => (
74158
<>
75159
<table className={styles.table}>
76-
<thead style={{ backgroundColor: '#F4F4F4' }}>
160+
<thead>
77161
<tr className={showHeader ? styles.tableHeaderRow : ''}>
78-
{headerCols.map((headerCol: HeaderCol, index: number) => (
162+
{headerCols.map((headerCol: HeaderCol, index: number, i) => (
79163
<th
80-
className={styles.tableHeadingTh}
164+
className={styles.tableHeadingTh}
81165
style={{
82166
width: headerCol.width,
83-
color: '#000',
167+
color: '#424240',
168+
fontSize: '14px',
84169
fontWeight: 700,
85170
}}
86171
key={index}
87172
>
88-
<Box
89-
paddingVertical={showHeader ? 'sm' : null}
90-
paddingLeft="lg"
91-
>
173+
<Box style={{ backgroundColor: 'rgba(217, 217, 217, 0.2)' }} paddingVertical={showHeader ? 'sm' : null} paddingLeft="lg">
92174
{headerCol.render && headerCol.render()}
93175
</Box>
94176
</th>
@@ -111,6 +193,7 @@ export const Table: React.FC<TableProps> = ({
111193
styles.tableRow,
112194
trOnClick && styles.clickableTableRow,
113195
)}
196+
style={{ backgroundColor: index % 2 !== 0 ? '#F5F3F9' : 'white' }}
114197
key={index}
115198
>
116199
{headerCols.map((headerCol: HeaderCol, index: number) => (
@@ -119,7 +202,7 @@ export const Table: React.FC<TableProps> = ({
119202
style={{ width: headerCol.width }}
120203
key={index}
121204
>
122-
<Box paddingVertical="md" paddingLeft="lg">
205+
<Box paddingVertical="sm" paddingLeft="lg">
123206
<Truncate maxLines={1}>
124207
{headerCol.renderRow(headerRow)}
125208
</Truncate>

0 commit comments

Comments
 (0)