Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw92
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Болатов Ален
hw92
Commits
669f18be
Commit
669f18be
authored
Apr 03, 2023
by
Рахметова Альбина
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created component for one post
parent
f4228b68
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
2 deletions
+46
-2
App.tsx
frontend/src/App.tsx
+2
-1
default-image.jpg
frontend/src/assets/default-image.jpg
+0
-0
logo.jpg
frontend/src/assets/logo.jpg
+0
-0
IPostProps.ts
frontend/src/components/Post/IPostProps.ts
+5
-0
Post.css
frontend/src/components/Post/Post.css
+0
-0
Post.tsx
frontend/src/components/Post/Post.tsx
+24
-0
HomePage.css
frontend/src/containers/HomePage/HomePage.css
+0
-0
HomePage.tsx
frontend/src/containers/HomePage/HomePage.tsx
+14
-0
IPost.ts
frontend/src/interfaces/IPost.ts
+1
-1
No files found.
frontend/src/App.tsx
View file @
669f18be
...
...
@@ -2,13 +2,14 @@ import { Container } from "@mui/material"
import
{
Route
,
Routes
}
from
"react-router-dom"
import
Layout
from
"./components/Layout/Layout"
import
'./App.css'
import
HomePage
from
"./containers/HomePage/HomePage"
const
App
=
()
=>
{
return
(
//@ts-ignore
<
Layout
>
<
Routes
>
<
Route
path=
{
'/'
}
element=
{
<
h1
>
HOME
</
h1
>
}
/>
<
Route
path=
{
'/'
}
element=
{
<
HomePage
/
>
}
/>
</
Routes
>
</
Layout
>
...
...
frontend/src/assets/default-image.jpg
0 → 100644
View file @
669f18be
10.2 KB
frontend/src/assets/logo.jpg
deleted
100644 → 0
View file @
f4228b68
32.4 KB
frontend/src/components/Post/IPostProps.ts
0 → 100644
View file @
669f18be
import
IPost
from
"../../interfaces/IPost"
;
export
default
interface
IPostProps
{
post
:
IPost
}
\ No newline at end of file
frontend/src/components/
index.tsx
→
frontend/src/components/
Post/Post.css
View file @
669f18be
File moved
frontend/src/components/Post/Post.tsx
0 → 100644
View file @
669f18be
import
{
FunctionComponent
,
ReactElement
}
from
"react"
;
import
IPostProps
from
"./IPostProps"
;
import
defaultImage
from
'../../assets/default-image.jpg'
const
Post
:
FunctionComponent
<
IPostProps
>
=
(
props
):
ReactElement
=>
{
return
(
<
div
className=
"post"
>
<
h3
>
user
</
h3
>
<
div
className=
"post_imageframe"
>
<
img
className=
"post_image"
src=
{
`${import.meta.env.VITE_BASE_URL}/uploads/${props.post.image}`
}
alt=
{
props
.
post
.
title
}
onError=
{
(
e
)
=>
{
e
.
currentTarget
.
src
=
defaultImage
}
}
/>
</
div
>
<
p
>
{
props
.
post
.
datetime
}
</
p
>
</
div
>
)
}
export
default
Post
\ No newline at end of file
frontend/src/containers/Home
.tsx
→
frontend/src/containers/Home
Page/HomePage.css
View file @
669f18be
File moved
frontend/src/containers/HomePage/HomePage.tsx
0 → 100644
View file @
669f18be
import
React
,
{
FunctionComponent
,
ReactElement
}
from
"react"
;
const
HomePage
:
FunctionComponent
=
():
ReactElement
=>
{
return
(
<
div
className=
"homepage"
>
<
div
className=
"container"
>
</
div
>
</
div
>
)
}
export
default
HomePage
\ No newline at end of file
frontend/src/interfaces/IPost.ts
View file @
669f18be
...
...
@@ -4,5 +4,5 @@ export default interface IPost {
title
:
string
description
:
string
image
:
File
|
undefined
|
string
datetime
:
Date
datetime
:
string
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment