-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Devteamvietnam/dev
add code design blog basic homepage
- Loading branch information
Showing
23 changed files
with
531 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"source.fixAll.eslint": true | ||
}, | ||
"cSpell.words": [ | ||
"bgcolor", | ||
"flowtype", | ||
"Parens", | ||
"precached", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import Container from '@mui/material/Container'; | ||
import Typography from '@mui/material/Typography'; | ||
import Link from '@mui/material/Link'; | ||
|
||
function Copyright() { | ||
return ( | ||
<Typography variant="body2" color="text.secondary" align="center"> | ||
{'Copyright © '} | ||
<Link color="inherit" href="https://devteamvietnam.github.io/shdsvn.com/"> | ||
SHDSVN | ||
</Link>{' '} | ||
{new Date().getFullYear()} | ||
{'.'} | ||
</Typography> | ||
); | ||
} | ||
|
||
interface FooterProps { | ||
description: string; | ||
title: string; | ||
} | ||
|
||
export class UIFooter extends React.Component<FooterProps> { | ||
render(): React.ReactNode { | ||
const { description, title } = this.props; | ||
return ( | ||
<Box component="footer" sx={{ bgcolor: 'background.paper', py: 6 }}> | ||
<Container maxWidth="lg"> | ||
<Typography variant="h6" align="center" gutterBottom> | ||
{title} | ||
</Typography> | ||
<Typography | ||
variant="subtitle1" | ||
align="center" | ||
color="text.secondary" | ||
component="p" | ||
> | ||
{description} | ||
</Typography> | ||
<Copyright /> | ||
</Container> | ||
</Box> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,77 @@ | ||
import React, { Component } from 'react'; | ||
|
||
import { | ||
Collapse, | ||
Navbar, | ||
NavbarToggler, | ||
NavbarBrand, | ||
Nav, | ||
NavItem, | ||
NavLink | ||
} from 'reactstrap'; | ||
|
||
import { AppContextProps } from '@/api'; | ||
import AppBar from '@mui/material/AppBar'; | ||
import Toolbar from '@mui/material/Toolbar'; | ||
import Typography from '@mui/material/Typography'; | ||
import Link from '@mui/material/Link'; | ||
import Button from '@mui/material/Button'; | ||
|
||
import logo from '../../assets/images/logo.svg'; | ||
import '../header/style.scss'; | ||
|
||
export class UIHeader extends Component<AppContextProps> { | ||
constructor(props) { | ||
super(props); | ||
import '../header/style.scss'; | ||
|
||
this.toggle = this.toggle.bind(this); | ||
interface HeaderProps { | ||
sections: Array<{ | ||
title: string; | ||
url: string; | ||
description: string; | ||
}>; | ||
title: string; | ||
} | ||
|
||
this.state = { | ||
isOpen: false | ||
}; | ||
} | ||
toggle() { | ||
this.setState({ | ||
isOpen: !this.state | ||
}); | ||
} | ||
export class UIHeader extends Component<HeaderProps> { | ||
render() { | ||
let name = 'SHDSVN'; | ||
const { sections, title } = this.props; | ||
|
||
return ( | ||
<div> | ||
<Navbar color="light" light expand="md"> | ||
<NavbarBrand href="/"> | ||
<img src={logo} className="App-logo-header" alt="logo" /> | ||
{name} | ||
</NavbarBrand> | ||
<NavbarToggler onClick={this.toggle} /> | ||
<Collapse navbar> | ||
<Nav className="ml-auto" navbar> | ||
<NavItem></NavItem> | ||
<NavItem> | ||
<NavLink href="https://github.com/Devteamvietnam/shdsvn.com"> | ||
GitHub | ||
</NavLink> | ||
</NavItem> | ||
</Nav> | ||
</Collapse> | ||
</Navbar> | ||
</div> | ||
<React.Fragment> | ||
<AppBar position="relative"> | ||
<Toolbar sx={{ borderBottom: 1, borderColor: 'divider' }}> | ||
<Typography | ||
component="h1" | ||
variant="h5" | ||
color="inherit" | ||
align="left" | ||
noWrap | ||
mt={1} | ||
sx={{ flex: 1 }} | ||
> | ||
{title} | ||
</Typography> | ||
<Typography | ||
component="h1" | ||
variant="h5" | ||
color="inherit" | ||
align="left" | ||
noWrap | ||
mt={1} | ||
sx={{ flex: 1 }} | ||
> | ||
<img src={logo} className="App-logo-header" alt="logo" /> | ||
</Typography> | ||
<Button variant="outlined" size="small"></Button> | ||
</Toolbar> | ||
<Toolbar | ||
component="nav" | ||
variant="dense" | ||
sx={{ justifyContent: 'center', overflowX: 'auto' }} | ||
> | ||
{sections.map(section => ( | ||
<Link | ||
color="inherit" | ||
rel="noopener" | ||
underline="none" | ||
key={section.title} | ||
variant="body1" | ||
href={section.url} | ||
sx={{ p: 2, flexShrink: 0 }} | ||
> | ||
{section.title} | ||
</Link> | ||
))} | ||
</Toolbar> | ||
</AppBar> | ||
</React.Fragment> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.App-logo-header { | ||
height: 5vmin; | ||
height: 6vmin; | ||
pointer-events: stroke; | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import * as React from 'react'; | ||
import ReactMarkdown from 'markdown-to-jsx'; | ||
import Typography from '@mui/material/Typography'; | ||
import Link from '@mui/material/Link'; | ||
import Box from '@mui/material/Box'; | ||
|
||
function MarkdownListItem(props: any) { | ||
return <Box component="li" sx={{ mt: 1, typography: 'body1' }} {...props} />; | ||
} | ||
|
||
const options = { | ||
overrides: { | ||
h1: { | ||
component: Typography, | ||
props: { | ||
gutterBottom: true, | ||
variant: 'h4', | ||
component: 'h1' | ||
} | ||
}, | ||
h2: { | ||
component: Typography, | ||
props: { gutterBottom: true, variant: 'h6', component: 'h2' } | ||
}, | ||
h3: { | ||
component: Typography, | ||
props: { gutterBottom: true, variant: 'subtitle1' } | ||
}, | ||
h4: { | ||
component: Typography, | ||
props: { | ||
gutterBottom: true, | ||
variant: 'caption', | ||
paragraph: true | ||
} | ||
}, | ||
p: { | ||
component: Typography, | ||
props: { paragraph: true } | ||
}, | ||
a: { component: Link }, | ||
li: { | ||
component: MarkdownListItem | ||
} | ||
} | ||
}; | ||
|
||
export default function Markdown(props: any) { | ||
return <ReactMarkdown options={options} {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as React from 'react'; | ||
import Typography from '@mui/material/Typography'; | ||
import Grid from '@mui/material/Grid'; | ||
import Card from '@mui/material/Card'; | ||
import CardActionArea from '@mui/material/CardActionArea'; | ||
import CardContent from '@mui/material/CardContent'; | ||
import CardMedia from '@mui/material/CardMedia'; | ||
|
||
interface FeaturedPostProps { | ||
post: { | ||
date: string; | ||
description: string; | ||
image: string; | ||
imageLabel: string; | ||
title: string; | ||
}; | ||
} | ||
|
||
export class UIFeaturedPost extends React.Component<FeaturedPostProps> { | ||
render() { | ||
const { post } = this.props; | ||
|
||
return ( | ||
<Grid item xs={12} md={6}> | ||
<CardActionArea component="a" href="#"> | ||
<Card elevation={2} sx={{ display: 'flex' }}> | ||
<CardContent sx={{ flex: 1 }}> | ||
<Typography component="h2" variant="h5"> | ||
{post.title} | ||
</Typography> | ||
<Typography variant="subtitle1" color="text.secondary"> | ||
{post.date} | ||
</Typography> | ||
<Typography variant="subtitle1" paragraph> | ||
{post.description} | ||
</Typography> | ||
<Typography variant="subtitle1" color="primary"> | ||
Continue reading... | ||
</Typography> | ||
</CardContent> | ||
<CardMedia | ||
component="img" | ||
sx={{ width: 160, display: { xs: 'none', sm: 'block' } }} | ||
image={post.image} | ||
alt={post.imageLabel} | ||
/> | ||
</Card> | ||
</CardActionArea> | ||
</Grid> | ||
); | ||
} | ||
} |
Oops, something went wrong.