Skip to content
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

Convert the about page to FC #36

Merged
merged 2 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
106 changes: 51 additions & 55 deletions src/Pages/About/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import Grid from '@material-ui/core/Grid'
import { withStyles, Theme, WithStyles, createStyles } from '@material-ui/core/styles'
import { Component } from 'react'
import { Card, CardContent, Grid } from '@material-ui/core'
import { createStyles, withStyles, type Theme, type WithStyles } from '@material-ui/core/styles'
import { Helmet } from 'react-helmet'
import { IconContext } from 'react-icons'
import { FaTwitterSquare } from 'react-icons/fa'
import { GoMarkGithub } from 'react-icons/go'

import PageTitleWrapper from '../../Shared/Styles/PageTitleWrapper'
import PageTitleWrapper from '../../Components/PageTitleWrapper'
import { MIN_TABLET_SIZE } from '../../Shared/Styles/StyleConstants'

const styleSettings = (theme: Theme) =>
Expand All @@ -28,54 +25,53 @@ const styleSettings = (theme: Theme) =>
},
})

class About extends Component<WithStyles<typeof styleSettings>> {
constructor(props: WithStyles<typeof styleSettings>) {
super(props)
}
const GITHUB_URL = 'https://github.com/roottool' as const
const TWITTER_URL = 'https://twitter.com/roottool' as const
const About = ({ classes }: WithStyles<typeof styleSettings>) => (
<div>
<PageTitleWrapper>About</PageTitleWrapper>
<Card className={classes.card}>
<CardContent>
<Grid container className={classes.contents} spacing={8}>
<Grid item xs={6}>
Name
</Grid>
<Grid item xs={6}>
roottool
</Grid>
<Grid item xs={6}>
Birthday
</Grid>
<Grid item xs={6}>
1990/8/15
</Grid>
<Grid item xs={6}>
<a href={GITHUB_URL}>
<IconContext.Provider value={{ size: '3em' }}>
<GoMarkGithub />
</IconContext.Provider>
</a>
</Grid>
<Grid item xs={6}>
<a href={TWITTER_URL}>
<IconContext.Provider value={{ size: '3em' }}>
<FaTwitterSquare />
</IconContext.Provider>
</a>
</Grid>
</Grid>
</CardContent>
</Card>
</div>
)

public render() {
const { classes } = this.props
return (
<div>
<Helmet>
<title>About - roottool&apos;s Portfolio Site</title>
</Helmet>
<PageTitleWrapper>About</PageTitleWrapper>
<Card className={classes.card}>
<CardContent>
<Grid container className={classes.contents} spacing={8}>
<Grid item xs={6}>
Name
</Grid>
<Grid item xs={6}>
roottool
</Grid>
<Grid item xs={6}>
Birthday
</Grid>
<Grid item xs={6}>
1990/8/15
</Grid>
<Grid item xs={6}>
<a href="https://github.com/roottool">
<IconContext.Provider value={{ size: '3em' }}>
<GoMarkGithub />
</IconContext.Provider>
</a>
</Grid>
<Grid item xs={6}>
<a href="https://twitter.com/roottool">
<IconContext.Provider value={{ size: '3em' }}>
<FaTwitterSquare />
</IconContext.Provider>
</a>
</Grid>
</Grid>
</CardContent>
</Card>
</div>
)
}
}
const Container = ({ classes }: WithStyles<typeof styleSettings>) => (
<>
<Helmet>
<title>About - roottool&apos;s Portfolio Site</title>
</Helmet>
<About classes={classes} />
</>
)

export default withStyles(styleSettings)(About)
export default withStyles(styleSettings)(Container)
2 changes: 1 addition & 1 deletion src/Pages/Hobbies/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Helmet } from 'react-helmet'
// redux関連
// components
// style
import PageTitleWrapper from '../../Shared/Styles/PageTitleWrapper'
import PageTitleWrapper from '../../Components/PageTitleWrapper'
import { MIN_TABLET_SIZE } from '../../Shared/Styles/StyleConstants'
import GameInfoTableWrapped from './Components/GameInfoTableWrapped'
import { ActionDispatcher } from './Container'
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/Skills/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { withStyles, WithStyles, createStyles } from '@material-ui/core/styles'
import { Component } from 'react'
import { Helmet } from 'react-helmet'

import PageTitleWrapper from '../../Shared/Styles/PageTitleWrapper'
import PageTitleWrapper from '../../Components/PageTitleWrapper'
import contents from './SkillsContents.json'

const styleSettings = () =>
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/Works/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { withStyles, WithStyles, createStyles } from '@material-ui/core/styles'
import React, { Component } from 'react'
import { Helmet } from 'react-helmet'

import PageTitleWrapper from '../../Shared/Styles/PageTitleWrapper'
import PageTitleWrapper from '../../Components/PageTitleWrapper'
import contents from './WorksContents.json'

const styleSettings = () =>
Expand Down