diff --git a/packages/client/src/pages/Lesson/LessonHeader.tsx b/packages/client/src/pages/Lesson/LessonHeader.tsx index eb8bbd63..40d33b25 100644 --- a/packages/client/src/pages/Lesson/LessonHeader.tsx +++ b/packages/client/src/pages/Lesson/LessonHeader.tsx @@ -8,9 +8,9 @@ import { Lesson, LessonState } from '../../containers/Lesson.container'; import { LessonProgress } from '../../components/LessonProgress/LessonProgress'; import { routes } from '../../router/routes'; - // const offset: Size = 'lg'; const CloseIcon = styled(Icon)` + cursor: pointer; `; const StyledLogo = styled(LogoMark)` @@ -18,28 +18,27 @@ const StyledLogo = styled(LogoMark)` `; const Header = styled.header<{ withProgress: boolean }>` - position: relative; - display: flex; - align-items: center; - padding: ${t.size()} ${t.size('lg')}; +position: relative; +display: flex; +align - items: center; +padding: ${t.size()} ${t.size('lg')}; & > div { - flex: 1; - text-align: center; - div { - margin: auto; - margin-top: ${t.size('sm')}; - max-width: 40rem; - } + flex: 1; + text - align: center; + div { + margin: auto; + margin - top: ${t.size('sm')}; + max - width: 40rem; } +} `; const Title = styled(Text)` - font-weight: ${t.fontWeight.bold}; - color: ${t.color('grey')}; +font - weight: ${t.fontWeight.bold}; +color: ${t.color('grey')}; `; - const CloseConfirmModal: React.FC<{ onClose: () => void } & ModalProps> = ({ onClose, ...props @@ -54,47 +53,53 @@ const CloseConfirmModal: React.FC<{ onClose: () => void } & ModalProps> = ({ setRedirect(true); }; - return Cancel, - - ]} - > - If you quit now, you will lose all your lesson progress! - ; + return ( + + Cancel + , + + ]} + > + If you quit now, you will lose all your lesson progress! + + ); }; -export const LessonHeader: React.FC<{ title?: string }> = ({ - title -}) => { +export const LessonHeader: React.FC<{ title?: string }> = ({ title }) => { const [modal, setModal] = useState(false); const { progress, lesson, lessonState } = Lesson.useContainer(); - - return
- - -
- {title && {title}} - {lessonState === LessonState.lesson && } -
- - setModal(true)} - size="lg" - color="grey.300" - /> - - setModal(false)} - show={modal} - /> -
; + return ( +
+
+ +
+ +
+ {title && {title}} + {lessonState === LessonState.lesson && ( + + )} +
+ + setModal(true)} + size="lg" + color="grey.300" + /> + + setModal(false)} show={modal} /> +
+ ); }; diff --git a/packages/client/src/pages/Lesson/Story/Story.tsx b/packages/client/src/pages/Lesson/Story/Story.tsx index 39616b9e..bff1aac9 100644 --- a/packages/client/src/pages/Lesson/Story/Story.tsx +++ b/packages/client/src/pages/Lesson/Story/Story.tsx @@ -1,5 +1,12 @@ import { ModuleLesson } from '@codement/api'; -import { Button, centerAbsolute, NavDots, theme as t, CharacterHTML, CharacterProps } from '@codement/ui'; +import { + Button, + centerAbsolute, + NavDots, + theme as t, + CharacterHTML, + CharacterProps +} from '@codement/ui'; import { Me } from '@codement/ui/lib/containers/Me.container'; import React, { useState, useMemo } from 'react'; import styled from 'styled-components'; @@ -27,16 +34,13 @@ const SkipButton = styled(Button)` export const StyledCharacter = styled(CharacterHTML)` position: absolute; - bottom: ${t.size('giant')}; + bottom: ${t.size('big')}; left: 50%; margin-left: -30rem; transform: translateX(-100%); `; - -export const Story: React.FC = ({ - lesson -}) => { +export const Story: React.FC = ({ lesson }) => { const { me } = Me.useContainer(); const { setLessonState: setState } = Lesson.useContainer(); const steps = lesson.lesson.storySections; @@ -60,34 +64,39 @@ export const Story: React.FC = ({ ]; const face = useMemo(() => faces[page % faces.length], [page]); - return <> - - - + return ( + <> + + + - + - - - - setState(LessonState.storyCompleted)} - color="grey" - > Skip story - - ; + + + + setState(LessonState.storyCompleted)} + color="grey" + > + {' '} + Skip story{' '} + + + + ); }; diff --git a/packages/ui/components/Character/Character.tsx b/packages/ui/components/Character/Character.tsx index d02117f5..96f655a7 100644 --- a/packages/ui/components/Character/Character.tsx +++ b/packages/ui/components/Character/Character.tsx @@ -8,7 +8,6 @@ import { theme as t } from '../../css/theme'; export * from './Characters'; - const StyledCharacter = styled.div` position: relative; width: 200px; @@ -18,26 +17,30 @@ const StyledCharacter = styled.div` transform: translateX(-50%); overflow: visible; - .ink { fill: ${t.color('primary.300')}; } - .background { fill: ${t.color('white')}; } + .ink { + fill: ${t.color('primary.300')}; + } + .background { + fill: ${t.color('white')}; + } } :after { - content: ""; + content: ''; display: block; - padding-bottom: 150%; + padding-bottom: 130%; } `; interface SvgProps { - value: string, + value: string; obj: any; } const Svg: React.FC = ({ value, obj, ...props }) => { const S = obj[value]; if (!S) throw new Error(`Could not find character part '${value}'`); - return ; + return ; }; const StyledBody = styled(Svg)` @@ -49,13 +52,13 @@ const StyledBody = styled(Svg)` const StyledHead = styled(Svg)` width: 50%; left: 56%; - bottom: 52%; + bottom: 50%; `; const StyledFace = styled(Svg)` width: 34%; left: 61%; - bottom: 59%; + bottom: 48%; `; export interface CharacterProps { @@ -65,9 +68,14 @@ export interface CharacterProps { } export const Character: React.FC = ({ - body, head, face, ...props -}) => - - - {face && } -; + body, + head, + face, + ...props +}) => ( + + + + {face && } + +);