generated from goitacademy/react-homework-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
348 additions
and
73 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,9 +1,13 @@ | ||
import { Profile } from './Profile/Profile'; | ||
import user from '../data/user.json'; | ||
import { Layout } from './Layout'; | ||
import { GlobalStyle } from './Globalstyle'; | ||
|
||
export const App = () => { | ||
return ( | ||
<div> | ||
<Layout> | ||
<GlobalStyle /> | ||
<Profile {...user} /> | ||
</div> | ||
</Layout> | ||
); | ||
}; |
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,40 @@ | ||
import { createGlobalStyle } from 'styled-components'; | ||
|
||
export const GlobalStyle = createGlobalStyle` | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6, | ||
p, | ||
ul, | ||
ol { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
ul { | ||
list-style: none; | ||
} | ||
img { | ||
display: block; | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
`; |
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,6 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Layout = styled.div` | ||
padding: 16px; | ||
background-color: #f0f8ff; | ||
`; |
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,34 +1,45 @@ | ||
export const Profile = props => { | ||
const { | ||
username, | ||
tag, | ||
location, | ||
avatar, | ||
stats: { followers, views, likes }, | ||
} = props; | ||
import { | ||
Avatar, | ||
Description, | ||
Info, | ||
Name, | ||
Stat, | ||
StatItem, | ||
StatLabel, | ||
StatValue, | ||
Wrapper, | ||
} from './Profile.styled'; | ||
|
||
export const Profile = ({ | ||
username, | ||
tag, | ||
location, | ||
avatar, | ||
stats: { followers, views, likes }, | ||
}) => { | ||
return ( | ||
<div> | ||
<div> | ||
<img src={avatar} alt={tag} /> | ||
<p>{username}</p> | ||
<p>@{tag}</p> | ||
<p>{location}</p> | ||
</div> | ||
<Wrapper> | ||
<Description> | ||
<Avatar src={avatar} alt={tag} /> | ||
<Name>{username}</Name> | ||
<Info>@{tag}</Info> | ||
<Info>{location}</Info> | ||
</Description> | ||
|
||
<ul> | ||
<li> | ||
<span>Followers</span> | ||
<span>{followers}</span> | ||
</li> | ||
<li> | ||
<span>Views</span> | ||
<span>{views}</span> | ||
</li> | ||
<li> | ||
<span>Likes</span> | ||
<span>{likes}</span> | ||
</li> | ||
</ul> | ||
</div> | ||
<Stat> | ||
<StatItem> | ||
<StatLabel>Followers</StatLabel> | ||
<StatValue>{followers}</StatValue> | ||
</StatItem> | ||
<StatItem> | ||
<StatLabel>Views</StatLabel> | ||
<StatValue>{views}</StatValue> | ||
</StatItem> | ||
<StatItem> | ||
<StatLabel>Likes</StatLabel> | ||
<StatValue>{likes}</StatValue> | ||
</StatItem> | ||
</Stat> | ||
</Wrapper> | ||
); | ||
}; |
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 +1,61 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.div` | ||
margin: auto; | ||
border-radius: 4px; | ||
border: 1px solid lightskyblue; | ||
width: 350px; | ||
background-color: white; | ||
`; | ||
|
||
export const Description = styled.div` | ||
text-align: center; | ||
padding: 32px; | ||
border: 1px solid lightskyblue; | ||
`; | ||
|
||
export const Avatar = styled.img` | ||
width: 160px; | ||
height: 160px; | ||
border-radius: 50%; | ||
margin: 0 auto; | ||
border: 1px solid lightskyblue; | ||
`; | ||
|
||
export const Name = styled.div` | ||
color: skyblue; | ||
margin-top: 16px; | ||
font-weight: bold; | ||
font-size: 24px; | ||
`; | ||
|
||
export const Info = styled.div` | ||
margin-top: 12px; | ||
font-size: 18px; | ||
color: skyblue; | ||
font-size: 16px; | ||
margin-bottom: 10px; | ||
`; | ||
|
||
export const Stat = styled.ul` | ||
display: flex; | ||
`; | ||
|
||
export const StatItem = styled.li` | ||
flex-basis: calc(100% / 3); | ||
text-align: center; | ||
background-color: lightskyblue; | ||
border: 1px solid lightskyblue; | ||
`; | ||
|
||
export const StatLabel = styled.p` | ||
margin-top: 16px; | ||
margin-bottom: 4px; | ||
color: white; | ||
`; | ||
|
||
export const StatValue = styled.p` | ||
color: whitesmoke; | ||
font-weight: bold; | ||
margin-bottom: 16px; | ||
`; |
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,15 +1 @@ | ||
@import-normalize; /* bring in normalize.css styles */ | ||
|
||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} | ||
@import-normalize; |
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