Skip to content

Commit

Permalink
basic team page structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ann-kilzer committed Jul 4, 2024
1 parent a83e04a commit 22d00cf
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/components/Header/DesktopHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const DesktopHeader: FC = () => {
<Typography variant="h1">WiSE Japan</Typography>
<Typography variant="caption">{t('header.subtitle')}</Typography>
</StyledNavLink>

<StyledNavLink to="/team" style={{ textDecoration: 'none', color: 'white' }}>
<Typography variant="overline">{t('header.team')}</Typography>
</StyledNavLink>
<StyledNavLink to="/codeofconduct" style={{ textDecoration: 'none', color: 'white' }}>
<Typography variant="overline">{t('header.codeOfConduct')}</Typography>
</StyledNavLink>
Expand Down
8 changes: 7 additions & 1 deletion src/components/Header/__test__/DesktopToolbar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ describe('Header', () => {
expect(title).toBeVisible()
})

it.todo('should show navigation links')
it('should show navigation links', async () => {
render(<DesktopHeader />)
const team = await screen.findByText('TEAM')

Check failure on line 15 in src/components/Header/__test__/DesktopToolbar.test.tsx

View workflow job for this annotation

GitHub Actions / unit-test

src/components/Header/__test__/DesktopToolbar.test.tsx > Header > should show navigation links

TestingLibraryElementError: Unable to find an element with the text: TEAM. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body> <div> <div aria-label="desktop-toolbar" class="MuiToolbar-root MuiToolbar-gutters MuiToolbar-regular css-16scsnq-MuiToolbar-root" > <div class="MuiStack-root css-1sos3zc-MuiStack-root" > <button aria-label="drawer-toggle-button" class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-v921om-MuiButtonBase-root-MuiIconButton-root" tabindex="0" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root" data-testid="MenuIcon" focusable="false" viewBox="0 0 24 24" > <path d="M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z" /> </svg> <span class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root" /> </button> <div class="PrivateSwipeArea-root css-n2n0ek" style="width: 20px;" /> <a aria-current="page" class="css-mv5f6b active" href="/" style="text-decoration: none; color: white;" > <h1 class="MuiTypography-root MuiTypography-h1 css-1jdp83k-MuiTypography-root" > WiSE Japan </h1> <span class="MuiTypography-root MuiTypography-caption css-1tgkcyn-MuiTypography-root" > Women in Software Engineering Japan </span> </a> <a class="css-mv5f6b" href="/team" style="text-decoration: none; color: white;" > <span class="MuiTypography-root MuiTypography-overline css-11oa5dr-MuiTypography-root" > Team </span> </a> <a class="css-mv5f6b" href="/codeofconduct" style="text-decoration: none; color: white;" > <span class="MuiTypography-root MuiTypography-overline css-11oa5dr-MuiTypography-root" > Code of Conduct </span> </a> </div> </div> </div> <div aria-hidden="true" aria-label="drawer" class="MuiDrawer-root MuiDrawer-modal MuiModal-root MuiModal-hidden css-12y4yjv-MuiModal-root-MuiDrawer-root" role="presentation" > <div aria-hidden="true" class="MuiBackdrop-root MuiModal-backdrop css-i9fmh8-MuiBackdrop-root-MuiModal-backdrop" style="opacity: 0; visibility: hidden;" /> <div data-testid="sentinelStart" tabindex="-1" /> <div class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation16 MuiDrawer-paper MuiDrawer-paperAnchorLeft css-12mf511-MuiPaper-root-MuiDrawer-paper" style="visibility: hidden; pointer-events: none; webkit-transform: translateX(-0px); transform: translateX(-0px);" tabindex="-1" > <div class="MuiBox-root css-1v5z18m" > <ul class="MuiList-root MuiList-padding css-h4y409-MuiList-root" > <li class="MuiListItem-root MuiListItem-gutters MuiListItem-padding css-1mtterh-MuiListItem-root" > <div class="MuiToggleButtonGroup-root css-bghv3y-MuiToggleButtonGroup-root" role="group" > <button aria-pressed="true" class="MuiButtonBase-root MuiToggleButtonGroup-grouped MuiToggleButtonGroup-groupedHorizontal MuiToggleButton-root Mui-selected MuiToggleButton-sizeMedium MuiToggleButton-standard MuiToggleButtonGroup-grouped MuiToggleButtonGroup-groupedHorizontal MuiToggleButtonGroup-firstButton css-1vm3fs0-MuiButtonBase-root-MuiToggleButton-root"
expect(team).toBeVisible()
const codeOfConduct = await screen.findByText('CODE OF CONDUCT')
expect(codeOfConduct).toBeVisible()
})
})
7 changes: 6 additions & 1 deletion src/components/SideDrawer/DrawerContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@ import { useTheme } from '@mui/material/styles'
import useMediaQuery from '@mui/material/useMediaQuery'
import StyledNavLink from '../StyledNavLink/StyledNavLink'
import LocaleToggle from '../LocaleToggle/LocaleToggle'
import { useTranslation } from 'react-i18next'

const DrawerContents: FC = () => {
const theme = useTheme()
const { t } = useTranslation();
let navList = <></>
if (useMediaQuery(theme.breakpoints.down('sm'))) {
navList = (<>
<ListItem>
<StyledNavLink to='/'>Home</StyledNavLink>
</ListItem>
<ListItem>
<StyledNavLink to='/codeofconduct'>Code of Conduct</StyledNavLink>
<StyledNavLink to='/team'>{t('sidebar.team')}</StyledNavLink>
</ListItem>
<ListItem>
<StyledNavLink to='/codeofconduct'>{t('sidebar.codeOfConduct')}</StyledNavLink>
</ListItem>
<Divider />
</>)
Expand Down
12 changes: 10 additions & 2 deletions src/i18n/en/translation.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"header": {
"codeOfConduct": "Code of Conduct",
"subtitle": "Women in Software Engineering Japan"
"subtitle": "Women in Software Engineering Japan",
"team": "Team"
},
"home": {
"helloWorld": "✨ Hello World ✨",
"joinUs": "✨ Join us on Slack ✨",
"paragraph1": "Many of us were saddened to hear of the sudden closure of Women Who Code. There is a need for an organization to empower diverse women in technology careers in Tokyo and across Japan.",
"paragraph2": "We are not giving up on this mission. Please join us in rebuilding community so that we can empower women in Japan in Software Engineering careers.",
"paragraph3": "Our events target professional women in software careers with 2+ years of experience. Beginners to seasoned professionals are welcome to participate. While this organization focuses on women, all genders are welcome at our events. Software-adjacent roles like Data Science, Product, UI/UX, Machine Learning, etc., are welcome, too."
},
"sidebar": {
"codeOfConduct": "Code of Conduct",
"team": "Team"
},
"team": {
"title": "✨ Leadership Team ✨"
}
}
}
12 changes: 10 additions & 2 deletions src/i18n/ja/translation.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"header": {
"codeOfConduct": "行動規範",
"subtitle": "ウーマン・イン・ソフトウェアエンジニアリング"
"subtitle": "ウーマン・イン・ソフトウェアエンジニアリング",
"team": "チーム"
},
"home": {
"helloWorld": "✨ Hello 世界 ✨",
"joinUs": "✨ スラックに参加する ✨",
"paragraph1": "Women Who Code(WWCode)の活動中止のニュースに対し、多くの人々が悲しみました。東京や日本全体で、IT業界の多様な女性を支援する組織が必要とされています。",
"paragraph2": "この使命を諦めるつもりはありません。WWCodeの志を引き継ぐために、日本の女性がソフトウェアエンジニアとしてキャリアを築けるよう、私たちと共にコミュニティを再構築していきます。",
"paragraph3": "私たちのイベントは、2年以上の経験を持つITプロフェッショナルの女性を中心に、新卒からベテランまでどなたでも参加できるイベントをやっています。この組織は女性に焦点を当てていますが、イベントにはすべてのジェンダーの方が歓迎されています。また、データサイエンティスト、プロダクトマネジャー、UI/UXデザイナー、機械学習エンジニアなどのソフトウェアに関連した役割も歓迎いたします。"
},
"sidebar": {
"codeOfConduct": "Code of Conduct",
"team": "チーム"
},
"team": {
"title": "✨ リーダーシップ・チーム ✨"
}
}
}
5 changes: 5 additions & 0 deletions src/routes/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Home from './Home/Home'
import BaseLayout from './BaseLayout'
import NotFound from './NotFound/NotFound'
import CodeOfConduct from './CodeOfConduct/CodeOfConduct'
import Team from './Team/Team'

const browserRouter = createHashRouter([{
element: <BaseLayout />,
Expand All @@ -20,6 +21,10 @@ const browserRouter = createHashRouter([{
path: 'codeofconduct',
element: <CodeOfConduct />
},
{
path: 'team',
element: <Team />
},
{
path: 'theme',
element: <ThemePreview />
Expand Down
14 changes: 14 additions & 0 deletions src/routes/Team/Team.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { FC } from 'react'
import Container from '@mui/material/Container'
import Typography from '@mui/material/Typography';
import { useTranslation } from 'react-i18next';

const Team: FC = () => {
const { t } = useTranslation();

return <Container style={{ padding: 32 }}>
<Typography variant="h1">{t('team.title')}</Typography>
</Container>
}

export default Team
12 changes: 12 additions & 0 deletions src/routes/Team/__test__/Team.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { describe, expect, it } from 'vitest'
import { render } from '@/tests/customRender'
import { screen } from '@testing-library/react'
import Team from '../Team';

describe('Team', () => {
it('should render the Team page', async () => {
render(<Team />)
const title = await screen.findByText('✨ Leadership Team ✨')
expect(title).toBeVisible()
})
});

0 comments on commit 22d00cf

Please sign in to comment.