Skip to content

Commit 4ac0048

Browse files
Merge pull request #144 from gridaco/staging
[Before Release] UI Polishments
2 parents f482133 + 8b4c568 commit 4ac0048

File tree

11 files changed

+157
-98
lines changed

11 files changed

+157
-98
lines changed

app/lib/app.css

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* {
2+
font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif;
3+
}
4+
15
#create {
26
box-shadow: none;
37
background: #18a0fb;
@@ -8,17 +12,6 @@
812
box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3);
913
}
1014

11-
h1,
12-
h2,
13-
h3,
14-
h4,
15-
h5,
16-
h6,
17-
sub,
18-
p {
19-
font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif;
20-
}
21-
2215
.jss3 {
2316
background-color: #000 !important;
2417
}

app/lib/components/icons-loader.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function IconsLoader() {
8484
);
8585
list = <IconList icons={icons} />;
8686
} else {
87-
list = <LinearProgress />;
87+
list = <StyledLinearProgress />;
8888
}
8989

9090
const handleScroll = () => {
@@ -388,6 +388,10 @@ const Input = styled.input`
388388
font-weight: 400;
389389
line-height: 17px;
390390
color: #adaeb2;
391+
392+
&::placeholder {
393+
color: #adaeb2;
394+
}
391395
`;
392396

393397
const SearchChecker = styled.div`
@@ -424,6 +428,20 @@ const SizeCheck = styled.div`
424428
padding: 0px 16px;
425429
`;
426430

431+
const StyledLinearProgress = styled(LinearProgress)`
432+
/* for reset body margin */
433+
margin: 0 -8px;
434+
435+
/* reset material-ui style */
436+
&.color-primary {
437+
background-color: #ecf1ff;
438+
}
439+
440+
&.barColorPrimary {
441+
background-color: #2562ff;
442+
}
443+
`;
444+
427445
const GridItem = styled(GridListTile)`
428446
height: 70px !important;
429447
display: flex;

app/lib/components/navigation/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from "./primary-workmode-select";
2+
export * from "./secondary-menu-dropdown";
23
export * from "./secondary-workmode-choice";
34
export * from "./secondary-workmode-menu";
45
export * from "./navigator-expansion-control-button";
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import React from "react";
2+
import { useHistory } from "react-router-dom";
3+
import { WorkMode, WorkScreen } from "../../navigation";
4+
import { SecondaryWorkmodeMenu } from "./secondary-workmode-menu";
5+
6+
type Stage = "production" | "development" | string;
7+
interface Menu {
8+
id: WorkMode | WorkScreen | string;
9+
name: string;
10+
stage: Stage;
11+
onSelect: () => void;
12+
}
13+
14+
export function signinOrLibraryMenu(): Menu {
15+
const history = useHistory();
16+
return {
17+
id: WorkScreen.signin,
18+
name: WorkScreen.signin,
19+
stage: "production",
20+
onSelect: () => {
21+
history.push("/signin");
22+
},
23+
};
24+
25+
//
26+
// TODO: return library menu when signed in.
27+
return {
28+
id: WorkMode.library,
29+
name: WorkMode.library,
30+
stage: "development",
31+
onSelect: () => {},
32+
};
33+
}
34+
35+
export function SecondaryMenuDropdown() {
36+
const history = useHistory();
37+
const menu: Menu[] = [
38+
signinOrLibraryMenu(),
39+
{
40+
id: WorkMode.asset,
41+
name: WorkMode.asset,
42+
stage: "development",
43+
onSelect: () => {},
44+
},
45+
{
46+
id: WorkMode.manage,
47+
name: WorkMode.manage,
48+
stage: "development",
49+
onSelect: () => {},
50+
},
51+
{
52+
id: WorkMode.tools,
53+
name: WorkMode.tools,
54+
stage: "development",
55+
onSelect: () => {},
56+
},
57+
{
58+
id: WorkMode.settings,
59+
name: WorkMode.settings,
60+
stage: "development",
61+
onSelect: () => {},
62+
},
63+
{
64+
id: "feedback-toggle",
65+
name: "Feedback",
66+
stage: "production",
67+
onSelect: () => {
68+
open("https://github.com/gridaco/assistant/issues/new/choose");
69+
},
70+
},
71+
{
72+
id: WorkMode.about,
73+
name: WorkMode.about,
74+
stage: "production",
75+
onSelect: () => {
76+
history.push("/about");
77+
},
78+
},
79+
].filter((m) => {
80+
if (process.env.NODE_ENV == "production") {
81+
return m.stage === "production";
82+
}
83+
return true; /** if not production, return all available menus */
84+
});
85+
86+
return (
87+
<SecondaryWorkmodeMenu<WorkMode | WorkScreen | string>
88+
menus={menu}
89+
onSelect={(id) => {
90+
menu.find((m) => m.id === id)?.onSelect();
91+
}}
92+
/>
93+
);
94+
}

app/lib/components/navigation/secondary-workmode-menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function SecondaryWorkmodeMenu<T extends string>(props: {
1212
}) {
1313
return (
1414
<Wrapper>
15-
<Column style={{ marginTop: "4px" }}>
15+
<Column style={{ marginTop: "20px" }}>
1616
<Row style={{ marginBottom: "4px" }}>
1717
{props.menus.map((menu, index) => {
1818
if (index < 3) {
@@ -29,7 +29,7 @@ export function SecondaryWorkmodeMenu<T extends string>(props: {
2929
}
3030
})}
3131
</Row>
32-
<Row>
32+
<Row style={{ marginBottom: "16px" }}>
3333
{props.menus.map((menu, index) => {
3434
if (index >= 3) {
3535
return (

app/lib/main/index.tsx

Lines changed: 5 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -47,77 +47,12 @@ import {
4747
WorkmodeScreenTabs,
4848
PrimaryWorkmodeSelect,
4949
NavigatorExpansionControlButton,
50-
SecondaryWorkmodeMenu,
50+
SecondaryMenuDropdown,
5151
} from "../components/navigation";
5252
import styled from "@emotion/styled";
5353
import { Column, Row } from "../components/style/global-style";
5454
import { UploadSteps } from "../components/upload-steps";
5555

56-
function MoreMenus() {
57-
const history = useHistory();
58-
const menu = [
59-
{
60-
id: WorkScreen.signin,
61-
name: WorkScreen.signin,
62-
stage: "production",
63-
onSelect: () => {
64-
history.push("/signin");
65-
},
66-
},
67-
{
68-
id: WorkMode.asset,
69-
name: WorkMode.asset,
70-
stage: "development",
71-
onSelect: () => {},
72-
},
73-
{
74-
id: WorkMode.manage,
75-
name: WorkMode.manage,
76-
stage: "development",
77-
onSelect: () => {},
78-
},
79-
{
80-
id: WorkMode.tools,
81-
name: WorkMode.tools,
82-
stage: "development",
83-
onSelect: () => {},
84-
},
85-
{
86-
id: WorkMode.library,
87-
name: WorkMode.library,
88-
stage: "development",
89-
onSelect: () => {},
90-
},
91-
{
92-
id: WorkMode.settings,
93-
name: WorkMode.settings,
94-
stage: "development",
95-
onSelect: () => {},
96-
},
97-
{
98-
id: WorkMode.about,
99-
name: WorkMode.about,
100-
stage: "production",
101-
onSelect: () => {
102-
history.push("/about");
103-
},
104-
},
105-
].filter((m) => {
106-
if (process.env.NODE_ENV == "production") {
107-
return m.stage === "production";
108-
}
109-
return true; /** if not production, return all available menus */
110-
});
111-
return (
112-
<SecondaryWorkmodeMenu<WorkMode | WorkScreen>
113-
menus={menu}
114-
onSelect={(id) => {
115-
menu.find((m) => m.id === id)?.onSelect();
116-
}}
117-
/>
118-
);
119-
}
120-
12156
function Screen(props: { screen: WorkScreen }) {
12257
switch (props.screen) {
12358
case WorkScreen.about:
@@ -220,10 +155,13 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
220155
const [workmodeSet, setWorkmodeSet] = useState<PrimaryWorkmodeSet>(
221156
props.savedLayout.workmodeSet
222157
);
158+
const [tabIndex, setTabIndex] = useState<number>(0);
159+
const [expansion, setExpansion] = useState<boolean>(true);
223160

224161
const on_workmode_select = (workmode: WorkMode) => {
225162
setWorkmode(workmode);
226163
setTabIndex(0);
164+
setExpansion(true);
227165
};
228166

229167
const on_work_select = (index, screen) => {
@@ -235,9 +173,6 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
235173
});
236174
};
237175

238-
const [tabIndex, setTabIndex] = useState<number>(0);
239-
const [expansion, setExpansion] = useState<boolean>(true);
240-
241176
return (
242177
<>
243178
<Wrapper>
@@ -259,7 +194,7 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
259194
onClick={() => setExpansion(!expansion)}
260195
/>
261196
</Row>
262-
{!expansion && <MoreMenus />}
197+
{!expansion && <SecondaryMenuDropdown />}
263198
</Column>
264199
</Wrapper>
265200

app/lib/pages/code/code-screen-footer.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function CodeScreenFooter(props: ICodeScreenFooter) {
3535
return (
3636
<CodeFooterCtaWrapper>
3737
<NextStepButton
38+
disabled={!props.app}
3839
onClick={() => {
3940
// TODO: the button component should be passed from outer side.
4041
}}
@@ -54,12 +55,12 @@ export function CodeScreenFooter(props: ICodeScreenFooter) {
5455
}
5556

5657
const CodeFooterCtaWrapper = styled.footer`
57-
padding: 12px 8px;
58+
/* 16 is body's padding */
59+
width: calc(100% - 16px);
60+
padding: 12px 16px;
5861
display: flex;
5962
background: #fff;
6063
position: absolute;
61-
/* 16 is body's padding */
62-
width: calc(100% - 16px);
6364
left: 0;
6465
bottom: 0;
6566
@@ -79,6 +80,10 @@ const NextStepButton = styled.button`
7980
color: #fff;
8081
background: #17181a;
8182
}
83+
&:disabled {
84+
color: #bbbbbb;
85+
background: #949494;
86+
}
8287
`;
8388

8489
const PreviewButton = styled.button`

app/lib/pages/signin/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,15 @@ function fetchUserProfile(): {
217217

218218
const StyledButton = styled.button`
219219
${ButtonStyle}
220-
width: calc(100vw - 54px);
220+
/* 58 is body margin 8*2 + parent padding 21*2 */
221+
width: calc(100vw - 58px);
221222
font-weight: bold;
222223
font-size: 14px;
223224
line-height: 17px;
224225
color: #ffffff;
225226
background: #2562ff;
226227
margin-bottom: 53px;
228+
border: 0;
227229
`;
228230

229231
export default Signin;

app/lib/pages/signin/style.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export const BackIcon = styled.div`
2020
`;
2121

2222
export const Inner = styled.div`
23-
margin-top: 120px;
23+
margin-top: 60px;
24+
25+
@media (min-height: 800px) {
26+
margin-top: 120px;
27+
}
2428
`;
2529

2630
export const Title = styled.h2`
@@ -33,9 +37,13 @@ export const Title = styled.h2`
3337
`;
3438

3539
export const BtnWrapper = styled.div`
36-
margin-top: 391px;
40+
/* margin-top: 391px; */
3741
position: absolute;
38-
bottom: 120px;
42+
bottom: 60px;
43+
44+
@media (min-height: 800px) {
45+
bottom: 120px;
46+
}
3947
`;
4048

4149
export const SignInBtn = styled.button`
@@ -71,7 +79,10 @@ export const Contents = styled.h6`
7179
`;
7280

7381
export const LinkWrapper = styled(Column)`
74-
margin-top: 90px;
82+
margin-top: 45px;
83+
@media (min-height: 800px) {
84+
margin-top: 90px;
85+
}
7586
`;
7687

7788
export const LinkContents = styled.a`

0 commit comments

Comments
 (0)