|
@@ -1,20 +1,117 @@
|
|
|
-import './App.scss'
|
|
|
-import logo from './hand.png'
|
|
|
-import React, {useState} from 'react';
|
|
|
+import React from 'react';
|
|
|
+import './App.scss';
|
|
|
|
|
|
-function App() {
|
|
|
- const [move, setMove] = useState("app__img");
|
|
|
+let arrStories = [
|
|
|
+ {
|
|
|
+ name: 'intellectfox',
|
|
|
+ src: 'intellectfox_s3eiyu.jpg',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'zuck',
|
|
|
+ src: 'zuck_ofva76.jpg'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'elon mask',
|
|
|
+ src: 'elon.mask_cwjn5g.jpg'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'tim cook',
|
|
|
+ src: 'tim_cook_ot6eos.jpg'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'bezos_we8ahw.jpg',
|
|
|
+ src: 'bezos_we8ahw.jpg',
|
|
|
+ }
|
|
|
+];
|
|
|
|
|
|
- const handleClick = () => {
|
|
|
- setMove(move === "app__img_move" ? "app__img" : "app__img_move")
|
|
|
+const arrHeader = [
|
|
|
+ {
|
|
|
+ src: 'foxgram_logo_te2l4m.svg',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ src: 'notifications_m1be8e.svg'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ src: 'direct_zvkzsg.svg'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ src: 'profile_xr60wq.svg'
|
|
|
}
|
|
|
+];
|
|
|
|
|
|
- return (
|
|
|
- <div className="app">
|
|
|
- <div className="app__header" onClick={handleClick}>
|
|
|
- Hello world!
|
|
|
- <img className={move} src={logo}/>
|
|
|
+const Header = () =>
|
|
|
+ <header className="header">
|
|
|
+ <div className="header__container">
|
|
|
+ {arrHeader.map(elem =>
|
|
|
+ <div key={elem.src} className="header__icons">
|
|
|
+ <img
|
|
|
+ src={`https://res.cloudinary.com/intellectfox/image/upload/v1629752944/fe/foxgram/header/${elem.src}`}/>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </header>;
|
|
|
+
|
|
|
+const Stories = () =>
|
|
|
+ <div className="stories_contant stories">
|
|
|
+ {arrStories.map(elem =>
|
|
|
+ <div key={elem.name} className="stories__icons">
|
|
|
+ <img className="stories__img_gr"
|
|
|
+ src={`https://res.cloudinary.com/intellectfox/image/upload/v1630263824/fe/foxgram/stories/${elem.src}`}/>
|
|
|
+ <div className="stories__icons_name">{elem.name}</div>
|
|
|
</div>
|
|
|
+ )}
|
|
|
+ </div>;
|
|
|
+
|
|
|
+const HeaderPost = ({authorName, authorImg}) =>
|
|
|
+ <div className="main__headerPosts">
|
|
|
+ <div className="main__logoHeaderContainer">
|
|
|
+ <img
|
|
|
+ src={authorImg}/>
|
|
|
+ </div>
|
|
|
+ <div className="main__textIntellectfoxHeader">{authorName}</div>
|
|
|
+ </div>;
|
|
|
+
|
|
|
+
|
|
|
+const FooterPost = ({quantity, iconName, footerText}) =>
|
|
|
+ <div className="main__footerPosts">
|
|
|
+ <div className="main__likes">
|
|
|
+ <div className="logo_heart"><img
|
|
|
+ src="https://res.cloudinary.com/intellectfox/image/upload/v1629752958/fe/foxgram/posts/like-filled_zurlii.svg"
|
|
|
+ className="heart_img"/>
|
|
|
+ <span className="main__textPostLikes">{quantity}</span><span className="main__markLike">отметок "Нравится"</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="footer_container">
|
|
|
+ <div className="text_intellectfox_footer">{iconName}</div>
|
|
|
+ <div className="footer_text">{footerText}</div>
|
|
|
+ </div>
|
|
|
+ </div>;
|
|
|
+
|
|
|
+const Post = ({src, likesCount, description, authorName, srcImgAuthor}) =>
|
|
|
+ <div className="main">
|
|
|
+ <HeaderPost authorImg={srcImgAuthor} authorName={authorName}/>
|
|
|
+ <div className="main__containerPosts"><img
|
|
|
+ src={src}/>
|
|
|
+ </div>
|
|
|
+ <FooterPost
|
|
|
+ quantity={likesCount}
|
|
|
+ iconName={authorName}
|
|
|
+ footerText={description}
|
|
|
+ />
|
|
|
+ </div>;
|
|
|
+
|
|
|
+function App() {
|
|
|
+ return (
|
|
|
+ <div className="App">
|
|
|
+ <Header/>
|
|
|
+ <Stories/>
|
|
|
+ <Post
|
|
|
+ srcImgAuthor={'https://res.cloudinary.com/intellectfox/image/upload/v1629752958/fe/foxgram/posts/intellectfox_jq4lbe.svg'}
|
|
|
+ likesCount={23}
|
|
|
+ authorName={'intellectfox'}
|
|
|
+ description={'Топ 8 ошибок начинающих Front-end разработчиков'}
|
|
|
+ src={"https://res.cloudinary.com/intellectfox/image/upload/v1629752958/fe/foxgram/posts/post-1_nm8jbv.jpg"}
|
|
|
+ />
|
|
|
</div>
|
|
|
);
|
|
|
}
|