-
-
-
-
-
- < Back to Tutorials
-
-
-
-
-
{`# ${props.tutorial.summary.title}`}
-
{`### ${props.tutorial.summary.description}`}
- {/*
+const Summary = (props: Props) => (
+
+
+
+
+
+
+
+ < Back to Tutorials
+
+
+
+
+
{`# ${props.tutorial.summary.title}`}
+
{`### ${props.tutorial.summary.description}`}
+ {/*
Created by {props.createdBy.name}
Last updated {moment(props.updatedAt).format('M/YYYY')}
*/}
-
-
-
-
Content
- {props.tutorial.levels.map((level: TT.Level, index: number) => (
-
-
{`### ${index + 1}. ${level.title}`}
-
- {level.summary}
-
+
+
+
+
Content
+ {props.tutorial.levels.map((level: TT.Level, index: number) => (
+
+
{`### ${index + 1}. ${level.title}`}
+
+ {level.summary}
- ))}
-
+
+ ))}
-
-
- {/* TODO Add back button */}
-
- Start
-
-
- )
-}
+
+
+ {/* TODO Add back button */}
+
+ Start
+
+
+
+)
export default Summary
diff --git a/web-app/src/containers/SelectTutorial/forms/TutorialFile.tsx b/web-app/src/containers/SelectTutorial/forms/TutorialFile.tsx
index da257446..e0930e64 100644
--- a/web-app/src/containers/SelectTutorial/forms/TutorialFile.tsx
+++ b/web-app/src/containers/SelectTutorial/forms/TutorialFile.tsx
@@ -1,6 +1,8 @@
import * as React from 'react'
import * as TT from 'typings/tutorial'
-import { Form } from '@alifd/next'
+import { css, jsx } from '@emotion/core'
+import { Icon, Form } from '@alifd/next'
+import { Theme } from '../../../styles/theme'
const FormItem = Form.Item
@@ -9,13 +11,19 @@ interface Props {
}
const styles = {
- uploadFileButton: {
+ form: {
+ maxWidth: '600px',
+ padding: '0 0.3rem',
+ },
+ uploadLabel: (theme: Theme) => ({
padding: '0.3rem 0.5rem',
- outline: '1px dotted rgb(51, 51, 51)',
- borderRadius: '0.2rem',
- fontWeight: 400,
- fontFamily:
- '-apple-system, system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;',
+ outline: `1.5px solid ${theme['$color-line1-3']}`,
+ fontSize: theme['$form-element-medium-font-size'],
+ fontFamily: theme['$font-family-base'],
+ color: theme['$color-text1-3'],
+ }),
+ uploadButton: {
+ display: 'none',
},
}
@@ -39,12 +47,13 @@ const TutorialFile = (props: Props) => {
}
return (
-
diff --git a/web-app/src/containers/Tutorial/index.tsx b/web-app/src/containers/Tutorial/index.tsx
index 1dd51469..2c5ddace 100644
--- a/web-app/src/containers/Tutorial/index.tsx
+++ b/web-app/src/containers/Tutorial/index.tsx
@@ -16,22 +16,29 @@ import Reset from './components/Reset'
import Continue from './components/Continue'
import ScrollContent from './components/ScrollContent'
import CompletedBanner from './components/CompletedBanner'
+import { Theme } from '../../styles/theme'
+import { useTheme } from 'emotion-theming'
const styles = {
page: {
- width: '100vw',
+ width: '100%',
+ maxWidth: '100%',
+ height: 'auto',
paddingBottom: '5rem',
},
- header: {
+ header: (theme: Theme) => ({
display: 'flex' as 'flex',
alignItems: 'center',
justifyContent: 'flex-start',
height: '2rem',
- backgroundColor: '#EBEBEB',
+ backgroundColor: theme['$color-fill1-4'],
fontSize: '1rem',
lineHeight: '1rem',
padding: '10px 0.4rem',
- },
+ }),
+ menuIcon: (theme: Theme) => ({
+ color: theme['$color-text1-4'],
+ }),
title: {
marginLeft: '0.5rem',
},
@@ -39,12 +46,12 @@ const styles = {
textDecoration: 'none',
color: 'inherit',
},
- footer: {
+ footer: (theme: Theme) => ({
display: 'flex' as 'flex',
flexDirection: 'row' as 'row',
justifyContent: 'space-between',
alignItems: 'center',
- height: '2rem',
+ height: theme['$footer-height'],
backgroundColor: 'black',
fontSize: '1rem',
lineHeight: '1rem',
@@ -53,9 +60,9 @@ const styles = {
bottom: 0,
left: 0,
right: 0,
- color: 'white',
+ color: theme['$color-white'],
zIndex: 1000,
- },
+ }),
completeFooter: {
position: 'fixed' as 'fixed',
bottom: 0,
@@ -63,21 +70,21 @@ const styles = {
right: 0,
zIndex: 1000,
},
- processes: {
+ processes: (theme: Theme) => ({
padding: '0 1rem',
position: 'fixed' as 'fixed',
- bottom: '2rem',
+ bottom: theme['$footer-height'],
left: 0,
right: 0,
top: 'auto',
- },
- testMessage: {
+ }),
+ testMessage: (theme: Theme) => ({
position: 'absolute' as 'absolute',
top: 'auto',
- bottom: '2rem',
+ bottom: theme['$footer-height'],
left: '5px',
right: '5px',
- },
+ }),
}
interface PageProps {
@@ -93,6 +100,7 @@ interface PageProps {
*/
const TutorialPage = (props: PageProps) => {
+ const theme: Theme = useTheme()
const { position, progress, processes, testStatus } = props.context
const tutorial = selectors.currentTutorial(props.context)
@@ -130,7 +138,7 @@ const TutorialPage = (props: PageProps) => {
@@ -155,7 +163,7 @@ const TutorialPage = (props: PageProps) => {
/>
) : (
-
+
)}
diff --git a/web-app/src/index.tsx b/web-app/src/index.tsx
index 50f95a64..52b9e790 100644
--- a/web-app/src/index.tsx
+++ b/web-app/src/index.tsx
@@ -7,7 +7,7 @@ import './mock'
import App from './App'
// init initial styles
-import './styles/index.css'
+import './styles/reset.css'
// init listeners
import './services/listeners'
diff --git a/web-app/src/styles/index.css b/web-app/src/styles/reset.css
similarity index 92%
rename from web-app/src/styles/index.css
rename to web-app/src/styles/reset.css
index de51430e..802f81bc 100644
--- a/web-app/src/styles/index.css
+++ b/web-app/src/styles/reset.css
@@ -1,5 +1,4 @@
@import 'https://github.com/~@alifd/next/dist/next.min.css';
-/* @import 'https://github.com/~@alifd/theme-4/dist/next.css'; */
@import 'https://github.com/font.css';
html {
diff --git a/web-app/src/styles/theme.tsx b/web-app/src/styles/theme.tsx
new file mode 100644
index 00000000..7e8bd5d6
--- /dev/null
+++ b/web-app/src/styles/theme.tsx
@@ -0,0 +1,152 @@
+// import variables from '@alifd/theme-1/variables'
+
+const theme = {
+ '$form-element-small-height': '20px',
+ '$form-element-medium-height': '28px',
+ '$form-element-large-height': '40px',
+ '$form-element-small-font-size': '12px',
+ '$form-element-medium-font-size': '12px',
+ '$form-element-large-font-size': '14px',
+ '$form-element-small-preview-height': '20px',
+ '$form-element-medium-preview-height': '28px',
+ '$form-element-large-preview-height': '40px',
+ '$form-element-small-preview-font-size': '12px',
+ '$form-element-medium-preview-font-size': '12px',
+ '$form-element-large-preview-font-size': '16px',
+ '$form-element-small-icon-size': '12px',
+ '$form-element-medium-icon-size': '12px',
+ '$form-element-large-icon-size': '16px',
+ '$form-element-small-corner': '30px',
+ '$form-element-medium-corner': '30px',
+ '$form-element-large-corner': '30px',
+ '$mask-background': '#000000',
+ '$mask-opacity': '0.45',
+ '$popup-local-border-width': '1px',
+ '$popup-local-border-style': 'solid',
+ '$popup-local-border-color': '#DCDEE3',
+ '$popup-local-corner': '5px',
+ '$popup-local-shadow': 'none',
+ '$popup-global-border-width': '0',
+ '$popup-global-border-style': 'solid',
+ '$popup-global-border-color': '#DCDEE3',
+ '$popup-global-corner': '5px',
+ '$popup-global-shadow': '0px 2px 6px 0px rgba(255, 106, 0, 0.3)',
+ '$color-brand1-1': '#DEE8FF',
+ '$color-brand1-6': '#5584FF',
+ '$color-brand1-9': '#3E71F7',
+ '$color-data1-1': '#00DCCD',
+ '$color-data1-2': '#506FED',
+ '$color-data1-3': '#AE66FC',
+ '$color-data1-4': '#FF445F',
+ '$color-data1-5': '#FF934D',
+ '$color-data1-6': '#FFD74D',
+ '$color-data1-7': '#4DDE6D',
+ '$color-data1-8': '#18B1F7',
+ '$color-white': '#FFFFFF',
+ '$color-black': '#000000',
+ '$color-transparent': 'transparent',
+ '$color-success-1': '#E4FDDA',
+ '$color-success-2': '#CDF2BE',
+ '$color-success-3': '#46BC15',
+ '$color-success-4': '#41A716',
+ '$color-notice-1': '#E3F2FD',
+ '$color-notice-2': '#BAD9FF',
+ '$color-notice-3': '#4494F9',
+ '$color-notice-4': '#2E7DE0',
+ '$color-warning-1': '#FFF3E0',
+ '$color-warning-2': '#FFE6BD',
+ '$color-warning-3': '#FF9300',
+ '$color-warning-4': '#EB7E10',
+ '$color-error-1': '#FFECE4',
+ '$color-error-2': '#FFC8B2',
+ '$color-error-3': '#FF3000',
+ '$color-error-4': '#E72B00',
+ '$color-help-1': '#E3FFF8',
+ '$color-help-2': '#C0ECE2',
+ '$color-help-3': '#01C1B2',
+ '$color-help-4': '#01A79A',
+ '$color-link-1': '#5584FF',
+ '$color-link-2': '#5584FF',
+ '$color-link-3': '#3E71F7',
+ '$color-other-1': '#FFEB3B',
+ '$color-other-2': '#FCCC12',
+ '$color-other-3': '#EABB06',
+ '$color-line1-1': '#E6E7EB',
+ '$color-line1-2': '#DCDEE3',
+ '$color-line1-3': '#C4C6CF',
+ '$color-line1-4': '#A0A2AD',
+ '$color-fill1-1': '#F7F8FA',
+ '$color-fill1-2': '#F2F3F7',
+ '$color-fill1-3': '#EBECF0',
+ '$color-fill1-4': '#E2E4E8',
+ '$color-text1-1': '#CCCCCC',
+ '$color-text1-2': '#999999',
+ '$color-text1-3': '#666666',
+ '$color-text1-4': '#000000',
+ '$color-disabled-1': 'lightgrey',
+ '$corner-1': '3px',
+ '$corner-2': '6px',
+ '$corner-3': '20px',
+ '$corner-circle': '50%',
+ '$corner-semicircle': '500px',
+ '$corner-zero': '0',
+ '$font-family-base': 'Roboto, "Helvetica Neue", Helvetica, Tahoma, Arial, "PingFang SC", "Microsoft YaHei"',
+ '$font-lineheight-1': '1.3',
+ '$font-lineheight-2': '1.5',
+ '$font-lineheight-3': '1.7',
+ '$font-size-display-3': '56px',
+ '$font-size-display-2': '48px',
+ '$font-size-display-1': '36px',
+ '$font-size-headline': '24px',
+ '$font-size-title': '20px',
+ '$font-size-subhead': '16px',
+ '$font-size-body-2': '14px',
+ '$font-size-body-1': '12px',
+ '$font-size-caption': '12px',
+ '$font-weight-1': 'lighter',
+ '$font-weight-thin': '200',
+ '$font-weight-light': '300',
+ '$font-weight-2': 'normal',
+ '$font-weight-medium': '500',
+ '$font-weight-semi-bold': '600',
+ '$font-weight-3': 'bold',
+ '$font-weight-extra-bold': '800',
+ '$font-weight-ultra-bold': '900',
+ '$icon-xxs': '8px',
+ '$icon-xs': '12px',
+ '$icon-s': '16px',
+ '$icon-m': '20px',
+ '$icon-l': '24px',
+ '$icon-xl': '32px',
+ '$icon-xxl': '48px',
+ '$icon-xxxl': '64px',
+ '$line-zero': '0',
+ '$line-1': '1px',
+ '$line-2': '2px',
+ '$line-3': '3px',
+ '$line-solid': 'solid',
+ '$line-dashed': 'dashed',
+ '$line-dotted': 'dotted',
+ '$shadow-zero': 'none',
+ '$shadow-1': '1px 1px 2px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-1-up': '0px -1px 2px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-1-right': '1px 0px 2px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-1-down': '0px 1px 2px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-1-left': '-1px 0px 2px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-2': '2px 2px 6px 0px rgba(255, 106, 0, 0.3)',
+ '$shadow-2-up': '0px -2px 6px 0px rgba(255, 106, 0, 0.3)',
+ '$shadow-2-right': '2px 0px 6px 0px rgba(255, 106, 0, 0.3)',
+ '$shadow-2-down': '0px 2px 6px 0px rgba(255, 106, 0, 0.3)',
+ '$shadow-2-left': '-2px 0px 6px 0px rgba(255, 106, 0, 0.3)',
+ '$shadow-3': '4px 4px 10px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-3-up': '0px -4px 10px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-3-right': '4px 0px 10px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-3-down': '0px 4px 10px 0px rgba(0, 0, 0, 0.1)',
+ '$shadow-3-left': '-4px 0px 10px 0px rgba(0, 0, 0, 0.1)',
+ '$footer-height': '2.2rem',
+ '$nav-height': '2rem',
+}
+
+export type Theme = typeof theme
+
+export default theme
diff --git a/web-app/stories/NewUserExperience.stories.tsx b/web-app/stories/NewUserExperience.stories.tsx
deleted file mode 100644
index b3402e9a..00000000
--- a/web-app/stories/NewUserExperience.stories.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { storiesOf } from '@storybook/react'
-import { action } from '@storybook/addon-actions'
-import React from 'react'
-import { css, jsx } from '@emotion/core'
-import SideBarDecorator from './utils/SideBarDecorator'
-import NewUserExperienceTutorial from '../src/components/NewUserExperience/NuxTutorial'
-
-const styles = {
- container: {
- position: 'absolute',
- bottom: 0,
- left: 0,
- right: 0,
- },
-}
-
-storiesOf('NewUserExperience', module)
- .addDecorator(SideBarDecorator)
- .add('NUXTutorial', () => (
-
-
-
- ))
diff --git a/web-app/stories/Step.stories.tsx b/web-app/stories/Step.stories.tsx
index 0ff50789..417d6438 100644
--- a/web-app/stories/Step.stories.tsx
+++ b/web-app/stories/Step.stories.tsx
@@ -75,15 +75,15 @@ storiesOf('Step', module)
subtasks={[
{
name: 'First Test',
- pass: false,
+ status: 'ACTIVE',
},
{
name: 'Second Test',
- pass: true,
+ status: 'COMPLETE',
},
{
name: 'Third Test',
- pass: false,
+ status: 'ACTIVE',
},
]}
/>
@@ -91,6 +91,6 @@ storiesOf('Step', module)
.add('Hints', () => (
<>
-
+
>
))
diff --git a/web-app/stories/utils/SideBarDecorator.tsx b/web-app/stories/utils/SideBarDecorator.tsx
index 318a6494..86e43863 100644
--- a/web-app/stories/utils/SideBarDecorator.tsx
+++ b/web-app/stories/utils/SideBarDecorator.tsx
@@ -1,6 +1,8 @@
import * as React from 'react'
import { css, jsx } from '@emotion/core'
import { Provider } from './ProviderDecorator'
+import { ThemeProvider } from 'emotion-theming'
+import theme from '../../src/styles/theme'
const styles = {
container: {
@@ -17,7 +19,9 @@ const styles = {
const SideBarDecorator = (storyFn) => (
- {storyFn()}
+
+ {storyFn()}
+
)
diff --git a/web-app/yarn.lock b/web-app/yarn.lock
index 1a122fb9..8588f3cc 100644
--- a/web-app/yarn.lock
+++ b/web-app/yarn.lock
@@ -40,6 +40,13 @@
react-transition-group "^2.2.1"
shallow-element-equals "^1.0.1"
+"@alifd/theme-1@^0.3.1":
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/@alifd/theme-1/-/theme-1-0.3.1.tgz#da3ddf986775b5c70ebf5111f5d6f11b6fac69bb"
+ integrity sha512-VdSsTifO5nvc0gl1yMkVv3XZsI5FNyg8Vv2+sb3C+ApIl7AL6FwKs8Ljc4AAlpfurT1Ke5tQpzgMV1ejrinAww==
+ dependencies:
+ "@alifd/next" "~1.20.4"
+
"@alifd/theme-4@^0.3.1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@alifd/theme-4/-/theme-4-0.3.1.tgz#be5f26f777a11122ab1def8d1f1333c0e7942d7e"