Skip to content

Commit

Permalink
feat: add hero image to auth pages (#3730)
Browse files Browse the repository at this point in the history
  • Loading branch information
benfurber committed Jul 6, 2024
1 parent 593f2e0 commit 10e8b6c
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 6 deletions.
22 changes: 22 additions & 0 deletions packages/components/assets/images/celebration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { CelebrationHero } from './CelebrationHero'

import type { Meta, StoryFn } from '@storybook/react'

export default {
title: 'Components/CelebrationHero',
component: CelebrationHero,
} as Meta<typeof CelebrationHero>

export const Default: StoryFn<typeof CelebrationHero> = () => (
<CelebrationHero />
)
7 changes: 7 additions & 0 deletions packages/components/src/CelebrationHero/CelebrationHero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Image } from 'theme-ui'

import Celebration from '../../assets/images/celebration.svg'

export const CelebrationHero = () => {
return <Image loading="lazy" src={Celebration} />
}
1 change: 1 addition & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { CommentItem } from './CommentItem/CommentItem'
export { CommentList } from './CommentList/CommentList'
export { CreateReply } from './CreateReply/CreateReply'
export { ConfirmModal } from './ConfirmModal/ConfirmModal'
export { CelebrationHero } from './CelebrationHero/CelebrationHero'
export { CreateComment } from './CreateComment/CreateComment'
export { DiscussionContainer } from './DiscussionContainer/DiscussionContainer'
export { DiscussionTitle } from './DiscussionTitle/DiscussionTitle'
Expand Down
10 changes: 8 additions & 2 deletions src/pages/SignIn/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import React, { useEffect, useState } from 'react'
import { Field, Form } from 'react-final-form'
import { Link, useNavigate } from 'react-router-dom'
import { observer } from 'mobx-react'
import { Button, FieldInput, TextNotification } from 'oa-components'
import {
Button,
CelebrationHero,
FieldInput,
TextNotification,
} from 'oa-components'
import { getFriendlyMessage } from 'oa-shared'
import { PasswordField } from 'src/common/Form/PasswordField'
import { useCommonStores } from 'src/common/hooks/useCommonStores'
Expand Down Expand Up @@ -114,10 +119,11 @@ const SignInPage = observer((props: IProps) => {
sx={{ width: '100%' }}
css={{ maxWidth: '620px' }}
mx={'auto'}
mt={['20px', '100px']}
mt={[5, 10]}
mb={3}
>
<Flex sx={{ flexDirection: 'column', width: '100%' }}>
<CelebrationHero />
<Card bg={'softblue'}>
<Flex px={3} py={2}>
<Heading>Welcome back</Heading>
Expand Down
10 changes: 8 additions & 2 deletions src/pages/SignUp/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { useState } from 'react'
import { Field, Form } from 'react-final-form'
import { Link, Navigate, useNavigate } from 'react-router-dom'
import { observer } from 'mobx-react'
import { Button, ExternalLink, FieldInput } from 'oa-components'
import {
Button,
CelebrationHero,
ExternalLink,
FieldInput,
} from 'oa-components'
import { FRIENDLY_MESSAGES } from 'oa-shared'
import { PasswordField } from 'src/common/Form/PasswordField'
import { useCommonStores } from 'src/common/hooks/useCommonStores'
Expand Down Expand Up @@ -123,10 +128,11 @@ const SignUpPage = observer(() => {
sx={{ width: '100%' }}
css={{ maxWidth: '620px' }}
mx={'auto'}
mt={20}
mt={[5, 10]}
mb={3}
>
<Flex sx={{ flexDirection: 'column', width: '100%' }}>
<CelebrationHero />
<Card bg={'softblue'}>
<Flex px={3} py={2} sx={{ width: '100%' }}>
<Heading>Hey, nice to see you here</Heading>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/SignUp/SignUpMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link } from 'react-router-dom'
import { Button } from 'oa-components'
import { Button, CelebrationHero } from 'oa-components'
import { Card, Flex, Heading, Text } from 'theme-ui'

const SignUpMessagePage = () => (
Expand All @@ -9,10 +9,11 @@ const SignUpMessagePage = () => (
sx={{ width: '100%' }}
css={{ maxWidth: '620px' }}
mx={'auto'}
mt={20}
mt={[5, 10]}
mb={3}
>
<Flex sx={{ flexDirection: 'column', width: '100%' }}>
<CelebrationHero />
<Card sx={{ backgroundColor: 'softblue', px: 3, py: 2 }}>
<Heading>Sent</Heading>
</Card>
Expand Down

0 comments on commit 10e8b6c

Please sign in to comment.