-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update digest news redirecting (#34)
- Loading branch information
1 parent
ef1fecb
commit cdc3b30
Showing
6 changed files
with
42 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
42 changes: 23 additions & 19 deletions
42
js_machine_front/src/scenes/news/components/newsPresentation.tsx
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,26 +1,30 @@ | ||
import React from 'react'; | ||
import { News } from '../models/news'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
export const NewsPresentation: React.FC<News> = (props) => { | ||
const newsDate: number = new Date(props.date).getDate(); | ||
const newsMonth: string = new Date(props.date).toLocaleString('ru', { month: 'short' }).toUpperCase(); | ||
const newsDate: number = new Date(props.date).getDate(); | ||
const newsMonth: string = new Date(props.date).toLocaleString('ru', {month: 'short'}).toUpperCase(); | ||
|
||
return ( | ||
<div className="news__wrapper"> | ||
<div className="news__read"> | ||
<div className="news__read-content">ЧИТАТЬ ></div> | ||
</div> | ||
<div className="news__content"> | ||
<div> | ||
<p className="news__day">{newsDate} {newsMonth}</p> | ||
</div> | ||
<div> | ||
<p className="news__title">{props.title}</p> | ||
</div> | ||
<div> | ||
<p className="news__description">{props.description}</p> | ||
</div> | ||
</div> | ||
return ( | ||
<div className="news__wrapper"> | ||
<Link to="/digestview"> | ||
<div className="news__read"> | ||
<div className="news__read-content">ЧИТАТЬ ></div> | ||
</div> | ||
); | ||
</Link> | ||
|
||
<div className="news__content"> | ||
<div> | ||
<p className="news__day">{newsDate} {newsMonth}</p> | ||
</div> | ||
<div> | ||
<p className="news__title">{props.title}</p> | ||
</div> | ||
<div> | ||
<p className="news__description">{props.description}</p> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
}; |
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 @@ | ||
.body{ | ||
.body { | ||
height: 100%; | ||
width: 100%; | ||
background-color: rgba(0,0,0,0.6); | ||
background-color: rgba(0, 0, 0, 0.6); | ||
} |
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