Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Lint with UX Flow #130

Merged
merged 30 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a0e04d8
add style: disable select
You-J Aug 16, 2021
6fbf029
Merge branch 'app-navigation' of https://github.com/gridaco/assistant…
You-J Aug 16, 2021
4a40fb6
fix: label style
You-J Aug 16, 2021
b1dbc4b
fix tabLayout disable contorl
You-J Aug 16, 2021
54efe71
Merge branch 'staging' of https://github.com/bridgedxyz/assistant int…
softmarshmallow Aug 16, 2021
0912e34
clean imports
softmarshmallow Aug 16, 2021
861673b
use plugin sdk store to save layout
softmarshmallow Aug 16, 2021
9b3826f
add: init layer
You-J Aug 16, 2021
d563f93
Merge branch 'feature/lint' of https://github.com/gridaco/assistant i…
You-J Aug 16, 2021
eed7864
add tab router
softmarshmallow Aug 16, 2021
900c7e1
routing implemented
softmarshmallow Aug 16, 2021
1a27f4f
add black page prevent
softmarshmallow Aug 16, 2021
80a1638
add memory router for on-iframe (plugin) usage
softmarshmallow Aug 17, 2021
42bc21f
extract pages
softmarshmallow Aug 17, 2021
030b9cf
extract dedicated router
softmarshmallow Aug 17, 2021
9c2e27f
stash add: lint-screen component
You-J Aug 17, 2021
64e90a5
add upload steps def
softmarshmallow Aug 17, 2021
ed7b6b2
add standalone routes handling
softmarshmallow Aug 17, 2021
b21419e
enabled event io for webdev
softmarshmallow Aug 17, 2021
e9cadd0
add saved layout loader
softmarshmallow Aug 17, 2021
038206b
add path tab wrapper - wip
softmarshmallow Aug 17, 2021
bead90d
fix plugin app to receive platform sync event from figma
softmarshmallow Aug 17, 2021
b3c519e
stash change: lint structure
You-J Aug 17, 2021
0a5fc52
stash add: fix-yourself component
You-J Aug 17, 2021
de4b97c
fix empty message view
You-J Aug 17, 2021
4c22f42
fix: choice component
You-J Aug 18, 2021
8aef1f6
add: fix your self page
You-J Aug 18, 2021
701cade
fix: style in lint page
You-J Aug 18, 2021
3717c12
Merge branch 'app-navigation' of https://github.com/gridaco/assistant…
You-J Aug 18, 2021
f116bdd
add: router in fix yourself
You-J Aug 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/lib/components/assets/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/lib/components/assets/expand-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/lib/components/assets/expand-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/lib/components/assets/expand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/lib/components/assets/left-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/lib/components/assets/right-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/lib/components/navigation/primary-workmode-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ const WorkmodeLabel = styled.h3<Props>`
font-size: 21px;
letter-spacing: 0em;
cursor: pointer;
user-select: none;

// reset for h3 init style
margin: 0;
margin-top: 8px;

&:first-child {
margin-right: 12px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Title = styled.h6`
text-transform: capitalize;
margin: 0; // for reset h6 inital margin
margin-right: 10px;
user-select: none;

/* &:nth-child(3n) {
margin-right: 0;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/components/navigation/secondary-workmode-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function SecondaryWorkmodeMenu(props: {
}) {
return (
<Wrapper>
<Column>
<Column style={{ marginTop: "4px" }}>
<Row style={{ marginBottom: "4px" }}>
{props.menus.map((menu, index) => {
if (index < 3) {
Expand Down
1 change: 1 addition & 0 deletions app/lib/components/navigation/workmode-screen-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function WorkmodeScreenTabs(props: {
TabIndicatorProps={{
style: {
display: "none",
userSelect: "none",
},
}}
>
Expand Down
13 changes: 11 additions & 2 deletions app/lib/components/style/global-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const ButtonStyle = css`
box-sizing: border-box;
padding-top: 16px;
padding-bottom: 16px;
cursor: pointer;

// FIXME: CHEKC IS RIGHT capitalize?
text-transform: capitalize;
Expand All @@ -28,6 +29,12 @@ export const BlackButton = css`
color: #fff;
background: #17181a;
}

&:disabled {
background: #949494;
color: #bbb;
border: 1px solid #949494;
}
`;

export const WhtieButton = css`
Expand All @@ -39,10 +46,12 @@ export const WhtieButton = css`

export const TransparencyButton = css`
${ButtonStyle}
color: #C1C1C1;
color: #c1c1c1;
border: 0;
background: rgba(255, 255, 255, 0);

&:hover {
background: rgba(255, 255, 255, 0);
background: rgba(255, 255, 255, 0.3);
}
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export enum Level {
warn = "warn",
warn = "warning",
error = "error",
none = "none",
ignore = "ignore",
Expand Down
36 changes: 36 additions & 0 deletions app/lib/lint/lint-error-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import * as React from "react";

export enum LintError {
text = "missingTextStyle",
name = "nameError",
mdi = "mdiTexture",
color = "missingColorStyleError",
}

interface Props {
id?: string;
}

export function LintErrorIcon(props: Props) {
const MdiTextureIcon =
require("../components/assets/mdi-texture.svg") as string;
const ColorErrorIcon =
require("../components/assets/missing-color-style-error.svg") as string;
const TextErrorIcon =
require("../components/assets/missing-text.svg") as string;
const NameErrorIcon =
require("../components/assets/name-error.svg") as string;

switch (props.id) {
case LintError.text:
return <img src={TextErrorIcon} />;
case LintError.name:
return <img src={NameErrorIcon} />;
case LintError.mdi:
return <img src={MdiTextureIcon} />;
case LintError.color:
return <img src={ColorErrorIcon} />;
default:
return <></>;
}
}
132 changes: 116 additions & 16 deletions app/lib/lint/lint-item-row/lint-item-row.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,124 @@
import * as React from "react"

import * as React from "react";
import styled from "@emotion/styled";
import { LintError, LintErrorIcon } from "../lint-error-icon";
import { LintLevelIndicator } from "../lint-level-indicator";
import { choiceItem } from "../lint-list-view";
import { OptionChoiceItem } from "../../pages/lint/lint-option-choice-item";

interface Props {
onTap: Function
name: string
icon?: any
onTap: Function;
name: string;
icon?: any;
expand: boolean;
level: string;
error: {
id: string;
name: string;
userMessage: string;
};
children?: any;
}

interface State {

function Options(children: any[]) {
return (
<>
{children.map((item, i) => {
return <OptionChoiceItem key={i} {...item} />;
})}
</>
);
}

export class LintItemRow extends React.Component<Props, State> {
constructor(props) {
super(props)
}
export function LintItemRow(props: Props) {
const CloseIcon = require("../../components/assets/close.svg") as string;
const ExpandIcon = require("../../components/assets/expand.svg") as string;

return (
<Wrapper>
<Outer onClick={() => props.onTap()}>
<Inner>
<IconWrapper>
<LintErrorIcon id={props.icon} />
</IconWrapper>

<Title>{props.error.name}</Title>
<IndicatorWrapper>
<LintLevelIndicator color={props.level} />
</IndicatorWrapper>

{props.expand ? <img src={CloseIcon} /> : <img src={ExpandIcon} />}
</Inner>
<SubTitle>{props.error.userMessage}</SubTitle>
</Outer>

render() {
return <>
<p>{this.props.name}</p>
</>
}
<ChoiceWrapper display={props.expand}>
{Options([choiceItem])}
</ChoiceWrapper>
</Wrapper>
);
}

const Wrapper = styled.div`
background: #fff;
height: 100px;
margin-bottom: 16px;

// for reset parent margin
margin-right: -16px;
margin-left: -16px;
padding: 16px;
padding-bottom: 32px;

&:hover {
background: #fcfcfc;
}
`;

const Outer = styled.div`
padding-bottom: 32px;
cursor: pointer;
`;

const Inner = styled.div`
display: flex;
align-items: center;
`;

const IconWrapper = styled.div`
margin-right: 6px;
`;

const IndicatorWrapper = styled.div`
margin-right: 10px;
`;

const Title = styled.h6`
margin: 0;
margin-right: auto;

font-style: normal;
font-weight: 500;
font-size: 16px;
line-height: 20px;
color: #202020;
`;

const SubTitle = styled.h6`
margin: 0;
font-size: 12px;
line-height: 14px;
margin-top: 4px;
max-width: 262px;

color: #666666;
`;

const ChoiceWrapper = styled.div<{ display: boolean }>`
margin-bottom: 5px;

&:last-child {
margin-bottom: 0;
}

display: ${(props) => (props.display ? "block" : "none")};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import * as React from "react";
import { Level } from "./lint-colors";

interface ILintLevelIndicator {
color: Level;
color: string;
}

export function LintLevelIndicator(props: ILintLevelIndicator) {
return <Indicator color={props.color} />;
}

interface IIndicator {
color: Level;
color: string;
}

const Indicator = styled.div<IIndicator>`
Expand All @@ -21,19 +21,19 @@ const Indicator = styled.div<IIndicator>`
border-radius: 50%;

${(props) =>
props.color === Level.warn
props.color == Level.warn
? css`
background: #ffc700;
`
: props.color === Level.error
: props.color == Level.error
? css`
background: #ff3a3a;
`
: props.color === Level.ignore
: props.color == Level.ignore
? css`
background: #c6c6c6;
`
: props.color === Level.todo
: props.color == Level.todo
? css`
background: #000;
`
Expand Down
4 changes: 0 additions & 4 deletions app/lib/lint/lint-list-view/index.ts

This file was deleted.

25 changes: 25 additions & 0 deletions app/lib/lint/lint-list-view/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/** @deprecated this is dummy. replace me */
export const dummy = "dummy";

export const choiceItem = {
selected: false,
choice: {
title: "choice 1",
explanation: "I’ll choose this option to resolve this issue.",
},
};

export const rowDummy = {
onTap: function T() {
// FIXME: here is setState
},
name: "hi",
icon: "missingTextStyle",
expand: false, // FIXME: here is state
level: "warning",
error: {
id: "id",
name: "Error name",
userMessage: "This error is caused by “layer-name” and needs to be fixed.",
},
};
Loading