Skip to content

Feature/theme #404

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

Merged
merged 8 commits into from
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
fix width scroll issue (except review page)
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed Jul 25, 2020
commit 9aa6a1b544a31d0cf2c9a55ab97cef303c7d8f08
1 change: 0 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const createCommands = ({ extensionPath, workspaceState }: CreateCommandP
return {
// initialize
[COMMANDS.START]: async () => {
console.log('start')
if (webview && webview.state.loaded) {
webview.createOrShow()
} else {
Expand Down
2 changes: 1 addition & 1 deletion web-app/.storybook/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { configure } from '@storybook/react'
import '../src/styles/index.css'
import '../src/styles/reset.css'

// setup acquireVsCodeApi mock
// @ts-ignore
Expand Down
8 changes: 4 additions & 4 deletions web-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import Routes from './Routes'
const App = () => (
/* @ts-ignore invalid in enUS locale typings for @alifd/[email protected] https://github.com/alibaba-fusion/next/commit/e3b934b */
<ConfigProvider locale={enUS}>
<ErrorBoundary>
<Workspace>
<Workspace>
<ErrorBoundary>
<ThemeProvider theme={theme}>
<Routes />
</ThemeProvider>
</Workspace>
</ErrorBoundary>
</ErrorBoundary>
</Workspace>
</ConfigProvider>
)

Expand Down
3 changes: 2 additions & 1 deletion web-app/src/components/Error/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const styles = {
alignItems: 'center' as 'center',
border: `0.5rem solid ${theme['$color-error-2']}`,
padding: '1rem',
width: '100vw',
width: '100%',
maxWidth: '100%',
height: '100%',
}),
content: (theme: Theme) => ({
Expand Down
6 changes: 3 additions & 3 deletions web-app/src/components/Workspace/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react'
import { css, jsx } from '@emotion/core'
import { useWindowResize } from './resize'
import { Theme } from '../../styles/theme'

interface Props {
Expand All @@ -13,13 +12,14 @@ const styles = {
position: 'relative' as 'relative',
margin: 0,
width: '100vw',
maxWidth: '100%',
backgroundColor: theme['$color-white'],
overflow: 'auto',
}),
}

const Workspace = ({ children }: Props) => {
const dimensions = useWindowResize()
return <div css={{ ...styles.page, ...dimensions }}>{children}</div>
return <div css={styles.page}>{children}</div>
}

export default Workspace
26 changes: 0 additions & 26 deletions web-app/src/components/Workspace/resize.ts

This file was deleted.

2 changes: 1 addition & 1 deletion web-app/src/containers/Loading/LoadingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const styles = {
flexDirection: 'column' as 'column',
alignItems: 'center',
justifyContent: 'center',
width: '100vw',
width: '100%',
},
}

Expand Down
2 changes: 1 addition & 1 deletion web-app/src/containers/Loading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const styles = {
alignItems: 'center' as 'center',
justifyContent: 'center' as 'center',
height: '100%',
width: '100vw',
width: '100%',
},
processes: {
padding: '0 1rem',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TutorialFile from './forms/TutorialFile'
const styles = {
formWrapper: {
padding: '1rem',
width: '100vw',
width: '100%',
height: 'auto',
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const styles = {
position: 'relative' as 'relative',
display: 'flex' as 'flex',
flexDirection: 'column' as 'column',
width: '100vw',
width: '100%',
},
nav: (theme: Theme) => ({
height: theme['$nav-height'],
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/containers/SelectTutorial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const styles = {
page: {
position: 'relative' as 'relative',
height: 'auto',
width: '100vw',
width: '100%',
},
selectPage: {
padding: '1rem',
Expand Down
9 changes: 6 additions & 3 deletions web-app/src/containers/Start/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import * as TT from 'typings/tutorial'
import BetaBadge from '../../components/BetaBadge'
import { css, jsx } from '@emotion/core'
import Button from '../../components/Button'
import { Theme } from '../../styles/theme'

const styles = {
page: {
page: (theme: Theme) => ({
position: 'relative' as 'relative',
display: 'flex' as 'flex',
flexDirection: 'column' as 'column',
width: '100vw',
width: '100%',
maxWidth: '100%',
height: '100vh',
},
backgroundColor: theme['$color-white'],
}),
header: {
flex: 1,
display: 'flex' as 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { Theme } from '../../../styles/theme'
const styles = {
banner: (theme: Theme) => ({
height: 'auto',
width: '100vw',
width: '100%',
backgroundColor: theme['$color-brand1-9'],
color: theme['$color-white'],
padding: '0.5rem 1rem',
}),
header: {
position: 'relative' as 'relative',
width: '100vw',
width: '100%',
},
headerMessage: {
marginLeft: '0.5rem',
Expand Down
1 change: 1 addition & 0 deletions web-app/src/containers/Tutorial/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const styles = {
text: {
padding: '0rem 1rem',
paddingBottom: '1rem',
width: '100%',
},
title: {
fontSize: '1.2rem',
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/containers/Tutorial/components/Level.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const styles = {
backgroundColor: theme['$color-white'],
position: 'relative' as 'relative',
height: 'auto',
width: '100vw',
width: '100%',
}),
content: {
display: 'flex' as 'flex',
Expand Down
6 changes: 4 additions & 2 deletions web-app/src/containers/Tutorial/containers/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import Markdown from '../../../components/Markdown'
import { Theme } from '../../../styles/theme'

const styles = {
container: {
container: (theme: Theme) => ({
display: 'flex' as 'flex',
flexDirection: 'column' as 'column',
},
backgroundColor: theme['$color-white'],
height: 'auto',
}),
header: (theme: Theme) => ({
display: 'flex' as 'flex',
alignItems: 'center',
Expand Down
26 changes: 12 additions & 14 deletions web-app/src/containers/Tutorial/containers/Review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ interface Props {
}

const styles = {
container: {
height: 'auto',
container: (theme: Theme) => ({
display: 'flex' as 'flex',
flexDirection: 'column' as 'column',
},
height: 'auto',
backgroundColor: theme['$color-white'],
paddingBottom: '2rem',
}),
header: (theme: Theme) => ({
display: 'flex' as 'flex',
alignItems: 'center',
Expand All @@ -33,13 +35,11 @@ const styles = {
alignItems: 'center',
fontSize: '70%',
},
levels: {
paddingBottom: '2rem',
},
levels: {},
}

const ReviewPage = (props: Props) => {
const [stepVisibility, setStepVisibility] = React.useState(false)
const [stepVisibility, setStepVisibility] = React.useState(true)
return (
<div css={styles.container}>
<div css={styles.header}>
Expand All @@ -49,16 +49,14 @@ const ReviewPage = (props: Props) => {
<Switch checked={stepVisibility} onChange={(checked) => setStepVisibility(checked)} />
</div>
</div>

<div css={styles.levels}>
{props.levels.map((level: T.LevelUI, index: number) => (
<div key={level.id}>
<div>
<Content title={level.title} content={level.content} />
{stepVisibility ? <Steps steps={level.steps} displayAll /> : null}
</div>
{/* divider */}
<>
<Content title={level.title} content={level.content} />
{stepVisibility ? <Steps steps={level.steps} displayAll /> : null}
{index < props.levels.length - 1 ? <hr /> : null}
</div>
</>
))}
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion web-app/src/containers/Tutorial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import { useTheme } from 'emotion-theming'

const styles = {
page: {
width: '100vw',
width: '100%',
maxWidth: '100%',
height: 'auto',
paddingBottom: '5rem',
},
header: (theme: Theme) => ({
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
File renamed without changes.