diff --git a/app/lib/app.css b/app/lib/app.css
index 00a35d05..bfb8f5ea 100644
--- a/app/lib/app.css
+++ b/app/lib/app.css
@@ -1,3 +1,7 @@
+* {
+ font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif;
+}
+
#create {
box-shadow: none;
background: #18a0fb;
@@ -8,17 +12,6 @@
box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3);
}
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-sub,
-p {
- font-family: "Helvetica Neue", "Helvetica", "Roboto", "Arial", sans-serif;
-}
-
.jss3 {
background-color: #000 !important;
}
diff --git a/app/lib/components/icons-loader.tsx b/app/lib/components/icons-loader.tsx
index 0f3e1cb5..48aed603 100644
--- a/app/lib/components/icons-loader.tsx
+++ b/app/lib/components/icons-loader.tsx
@@ -84,7 +84,7 @@ export function IconsLoader() {
);
list = ;
} else {
- list = ;
+ list = ;
}
const handleScroll = () => {
@@ -388,6 +388,10 @@ const Input = styled.input`
font-weight: 400;
line-height: 17px;
color: #adaeb2;
+
+ &::placeholder {
+ color: #adaeb2;
+ }
`;
const SearchChecker = styled.div`
@@ -424,6 +428,20 @@ const SizeCheck = styled.div`
padding: 0px 16px;
`;
+const StyledLinearProgress = styled(LinearProgress)`
+ /* for reset body margin */
+ margin: 0 -8px;
+
+ /* reset material-ui style */
+ &.color-primary {
+ background-color: #ecf1ff;
+ }
+
+ &.barColorPrimary {
+ background-color: #2562ff;
+ }
+`;
+
const GridItem = styled(GridListTile)`
height: 70px !important;
display: flex;
diff --git a/app/lib/components/navigation/index.ts b/app/lib/components/navigation/index.ts
index 77edc2d5..84377ac7 100644
--- a/app/lib/components/navigation/index.ts
+++ b/app/lib/components/navigation/index.ts
@@ -1,4 +1,5 @@
export * from "./primary-workmode-select";
+export * from "./secondary-menu-dropdown";
export * from "./secondary-workmode-choice";
export * from "./secondary-workmode-menu";
export * from "./navigator-expansion-control-button";
diff --git a/app/lib/components/navigation/secondary-menu-dropdown.tsx b/app/lib/components/navigation/secondary-menu-dropdown.tsx
new file mode 100644
index 00000000..7581ebd1
--- /dev/null
+++ b/app/lib/components/navigation/secondary-menu-dropdown.tsx
@@ -0,0 +1,94 @@
+import React from "react";
+import { useHistory } from "react-router-dom";
+import { WorkMode, WorkScreen } from "../../navigation";
+import { SecondaryWorkmodeMenu } from "./secondary-workmode-menu";
+
+type Stage = "production" | "development" | string;
+interface Menu {
+ id: WorkMode | WorkScreen | string;
+ name: string;
+ stage: Stage;
+ onSelect: () => void;
+}
+
+export function signinOrLibraryMenu(): Menu {
+ const history = useHistory();
+ return {
+ id: WorkScreen.signin,
+ name: WorkScreen.signin,
+ stage: "production",
+ onSelect: () => {
+ history.push("/signin");
+ },
+ };
+
+ //
+ // TODO: return library menu when signed in.
+ return {
+ id: WorkMode.library,
+ name: WorkMode.library,
+ stage: "development",
+ onSelect: () => {},
+ };
+}
+
+export function SecondaryMenuDropdown() {
+ const history = useHistory();
+ const menu: Menu[] = [
+ signinOrLibraryMenu(),
+ {
+ id: WorkMode.asset,
+ name: WorkMode.asset,
+ stage: "development",
+ onSelect: () => {},
+ },
+ {
+ id: WorkMode.manage,
+ name: WorkMode.manage,
+ stage: "development",
+ onSelect: () => {},
+ },
+ {
+ id: WorkMode.tools,
+ name: WorkMode.tools,
+ stage: "development",
+ onSelect: () => {},
+ },
+ {
+ id: WorkMode.settings,
+ name: WorkMode.settings,
+ stage: "development",
+ onSelect: () => {},
+ },
+ {
+ id: "feedback-toggle",
+ name: "Feedback",
+ stage: "production",
+ onSelect: () => {
+ open("https://github.com/gridaco/assistant/issues/new/choose");
+ },
+ },
+ {
+ id: WorkMode.about,
+ name: WorkMode.about,
+ stage: "production",
+ onSelect: () => {
+ history.push("/about");
+ },
+ },
+ ].filter((m) => {
+ if (process.env.NODE_ENV == "production") {
+ return m.stage === "production";
+ }
+ return true; /** if not production, return all available menus */
+ });
+
+ return (
+
+ menus={menu}
+ onSelect={(id) => {
+ menu.find((m) => m.id === id)?.onSelect();
+ }}
+ />
+ );
+}
diff --git a/app/lib/components/navigation/secondary-workmode-menu.tsx b/app/lib/components/navigation/secondary-workmode-menu.tsx
index b2d3165d..7beb1673 100644
--- a/app/lib/components/navigation/secondary-workmode-menu.tsx
+++ b/app/lib/components/navigation/secondary-workmode-menu.tsx
@@ -12,7 +12,7 @@ export function SecondaryWorkmodeMenu(props: {
}) {
return (
-
+
{props.menus.map((menu, index) => {
if (index < 3) {
@@ -29,7 +29,7 @@ export function SecondaryWorkmodeMenu(props: {
}
})}
-
+
{props.menus.map((menu, index) => {
if (index >= 3) {
return (
diff --git a/app/lib/main/index.tsx b/app/lib/main/index.tsx
index 97b91ee7..fecd2ded 100644
--- a/app/lib/main/index.tsx
+++ b/app/lib/main/index.tsx
@@ -47,77 +47,12 @@ import {
WorkmodeScreenTabs,
PrimaryWorkmodeSelect,
NavigatorExpansionControlButton,
- SecondaryWorkmodeMenu,
+ SecondaryMenuDropdown,
} from "../components/navigation";
import styled from "@emotion/styled";
import { Column, Row } from "../components/style/global-style";
import { UploadSteps } from "../components/upload-steps";
-function MoreMenus() {
- const history = useHistory();
- const menu = [
- {
- id: WorkScreen.signin,
- name: WorkScreen.signin,
- stage: "production",
- onSelect: () => {
- history.push("/signin");
- },
- },
- {
- id: WorkMode.asset,
- name: WorkMode.asset,
- stage: "development",
- onSelect: () => {},
- },
- {
- id: WorkMode.manage,
- name: WorkMode.manage,
- stage: "development",
- onSelect: () => {},
- },
- {
- id: WorkMode.tools,
- name: WorkMode.tools,
- stage: "development",
- onSelect: () => {},
- },
- {
- id: WorkMode.library,
- name: WorkMode.library,
- stage: "development",
- onSelect: () => {},
- },
- {
- id: WorkMode.settings,
- name: WorkMode.settings,
- stage: "development",
- onSelect: () => {},
- },
- {
- id: WorkMode.about,
- name: WorkMode.about,
- stage: "production",
- onSelect: () => {
- history.push("/about");
- },
- },
- ].filter((m) => {
- if (process.env.NODE_ENV == "production") {
- return m.stage === "production";
- }
- return true; /** if not production, return all available menus */
- });
- return (
-
- menus={menu}
- onSelect={(id) => {
- menu.find((m) => m.id === id)?.onSelect();
- }}
- />
- );
-}
-
function Screen(props: { screen: WorkScreen }) {
switch (props.screen) {
case WorkScreen.about:
@@ -220,10 +155,13 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
const [workmodeSet, setWorkmodeSet] = useState(
props.savedLayout.workmodeSet
);
+ const [tabIndex, setTabIndex] = useState(0);
+ const [expansion, setExpansion] = useState(true);
const on_workmode_select = (workmode: WorkMode) => {
setWorkmode(workmode);
setTabIndex(0);
+ setExpansion(true);
};
const on_work_select = (index, screen) => {
@@ -235,9 +173,6 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
});
};
- const [tabIndex, setTabIndex] = useState(0);
- const [expansion, setExpansion] = useState(true);
-
return (
<>
@@ -259,7 +194,7 @@ function TabNavigationApp(props: { savedLayout: NavigationStoreState }) {
onClick={() => setExpansion(!expansion)}
/>
- {!expansion && }
+ {!expansion && }
diff --git a/app/lib/pages/code/code-screen-footer.tsx b/app/lib/pages/code/code-screen-footer.tsx
index c6e79eae..9bb547ca 100644
--- a/app/lib/pages/code/code-screen-footer.tsx
+++ b/app/lib/pages/code/code-screen-footer.tsx
@@ -35,6 +35,7 @@ export function CodeScreenFooter(props: ICodeScreenFooter) {
return (
{
// TODO: the button component should be passed from outer side.
}}
@@ -54,12 +55,12 @@ export function CodeScreenFooter(props: ICodeScreenFooter) {
}
const CodeFooterCtaWrapper = styled.footer`
- padding: 12px 8px;
+ /* 16 is body's padding */
+ width: calc(100% - 16px);
+ padding: 12px 16px;
display: flex;
background: #fff;
position: absolute;
- /* 16 is body's padding */
- width: calc(100% - 16px);
left: 0;
bottom: 0;
@@ -79,6 +80,10 @@ const NextStepButton = styled.button`
color: #fff;
background: #17181a;
}
+ &:disabled {
+ color: #bbbbbb;
+ background: #949494;
+ }
`;
const PreviewButton = styled.button`
diff --git a/app/lib/pages/signin/index.tsx b/app/lib/pages/signin/index.tsx
index 640fa61d..074cb776 100644
--- a/app/lib/pages/signin/index.tsx
+++ b/app/lib/pages/signin/index.tsx
@@ -217,13 +217,15 @@ function fetchUserProfile(): {
const StyledButton = styled.button`
${ButtonStyle}
- width: calc(100vw - 54px);
+ /* 58 is body margin 8*2 + parent padding 21*2 */
+ width: calc(100vw - 58px);
font-weight: bold;
font-size: 14px;
line-height: 17px;
color: #ffffff;
background: #2562ff;
margin-bottom: 53px;
+ border: 0;
`;
export default Signin;
diff --git a/app/lib/pages/signin/style.ts b/app/lib/pages/signin/style.ts
index 189dc8c5..c87845c0 100644
--- a/app/lib/pages/signin/style.ts
+++ b/app/lib/pages/signin/style.ts
@@ -20,7 +20,11 @@ export const BackIcon = styled.div`
`;
export const Inner = styled.div`
- margin-top: 120px;
+ margin-top: 60px;
+
+ @media (min-height: 800px) {
+ margin-top: 120px;
+ }
`;
export const Title = styled.h2`
@@ -33,9 +37,13 @@ export const Title = styled.h2`
`;
export const BtnWrapper = styled.div`
- margin-top: 391px;
+ /* margin-top: 391px; */
position: absolute;
- bottom: 120px;
+ bottom: 60px;
+
+ @media (min-height: 800px) {
+ bottom: 120px;
+ }
`;
export const SignInBtn = styled.button`
@@ -71,7 +79,10 @@ export const Contents = styled.h6`
`;
export const LinkWrapper = styled(Column)`
- margin-top: 90px;
+ margin-top: 45px;
+ @media (min-height: 800px) {
+ margin-top: 90px;
+ }
`;
export const LinkContents = styled.a`
diff --git a/figma-core/code-thread/resize-screen.ts b/figma-core/code-thread/resize-screen.ts
index 96a5f3b3..067fecb1 100644
--- a/figma-core/code-thread/resize-screen.ts
+++ b/figma-core/code-thread/resize-screen.ts
@@ -3,10 +3,12 @@ import { addEventHandler } from "./message-handler";
export function __register__() {
addEventHandler("resize", (msg) => {
const MIN_WIDTH = 320;
- const MIN_HEIGHT = 600;
+ const MIN_HEIGHT = 568;
const w = Math.max(MIN_WIDTH, msg.size.w);
const h = Math.max(MIN_HEIGHT, msg.size.h);
figma.ui.resize(w, h);
- figma.clientStorage.setAsync("size", { w: w, h: h }).catch((err) => {}); // save size
+ figma.clientStorage
+ .setAsync("figma-plugin-ui-size", { w: w, h: h })
+ .catch((err) => {}); // save size
});
}
diff --git a/figma-core/code-thread/show-ui.ts b/figma-core/code-thread/show-ui.ts
index cfba971b..e82714bf 100644
--- a/figma-core/code-thread/show-ui.ts
+++ b/figma-core/code-thread/show-ui.ts
@@ -1,16 +1,14 @@
-import { addEventHandler } from "./message-handler";
-
export async function showUI() {
// communicates with ui.html
// load plugin with confugured w/h
// restore previous size
- let size: { w: number; h: number } = { w: 414, h: 896 };
+ let size: { w: number; h: number } = { w: 375, h: 667 };
try {
const savedsize: {
w: number;
h: number;
- } = await figma.clientStorage.getAsync("size");
+ } = await figma.clientStorage.getAsync("figma-plugin-ui-size");
savedsize && (size = savedsize);
} catch (_) {}