-
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.
Merge pull request #155 from manuelc2209/feat/context-forum
Context Forum
- Loading branch information
Showing
22 changed files
with
272 additions
and
50 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
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
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,2 +1,3 @@ | ||
export * from './banner'; | ||
export * from './header'; | ||
export * from './thread'; |
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,7 +1,27 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const StyledContainer = styled.div``; | ||
export const StyledContainer = styled.div` | ||
display: flex; | ||
gap: 32px; | ||
padding: 16px; | ||
flex: 1; | ||
box-sizing: border-box; | ||
background-color: #f7f7f7; | ||
border: 1px solid #dddddd; | ||
justify-content: space-between; | ||
min-height: 100px; | ||
`; | ||
|
||
export const StyledStart = styled.div``; | ||
export const StyledMiddle = styled.div``; | ||
export const StyledEnd = styled.div``; | ||
export const StyledStart = styled.div` | ||
flex-direction: column; | ||
`; | ||
|
||
export const StyledMiddle = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
`; | ||
|
||
export const StyledEnd = styled.div` | ||
flex-direction: column; | ||
`; |
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,2 +1,2 @@ | ||
export * from './pages'; | ||
export { ForumBody } from './layout'; | ||
export * from './pages/Outlet'; | ||
export { Threads } from './pages/Threads'; |
File renamed without changes.
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
import { nanoid } from 'nanoid'; | ||
import React, { useContext } from 'react'; | ||
|
||
import { Thread } from '../../components'; | ||
import { ForumContext } from '../../context/forumContext'; | ||
|
||
import { StyledContainer, StyledSideSection, StyledThreadContainer } from './styles'; | ||
|
||
export const ThreadsView = () => { | ||
const { threads } = useContext(ForumContext); | ||
|
||
return ( | ||
<StyledContainer> | ||
<StyledThreadContainer> | ||
{threads?.map((thread) => ( | ||
<Thread | ||
key={nanoid()} | ||
avatar={thread.avatar} | ||
sideSection={thread.sideSection} | ||
title={thread.title} | ||
subtitle={thread.subtitle} | ||
/> | ||
))} | ||
</StyledThreadContainer> | ||
<StyledSideSection> | ||
<div>sample</div> | ||
</StyledSideSection> | ||
</StyledContainer> | ||
); | ||
}; |
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,26 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const StyledContainer = styled.div` | ||
display: flex; | ||
flex: 1; | ||
padding: 1rem 10rem; | ||
overflow-y: auto; | ||
gap: 16px; | ||
`; | ||
|
||
export const StyledThreadContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1; | ||
gap: 16px; | ||
`; | ||
|
||
export const StyledSideSection = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
min-width: 300px; | ||
padding: 16px; | ||
gap: 16px; | ||
background-color: #f7f7f7; | ||
border: 1px solid #dddddd; | ||
`; |
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,2 @@ | ||
export * from './ForumBody'; | ||
export * from './ThreadsView'; | ||
export { Container } from './Container'; |
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,7 @@ | ||
import React from 'react'; | ||
|
||
import { Container } from '../../layout'; | ||
|
||
export const ForumOutlet = () => { | ||
return <Container />; | ||
}; |
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,16 @@ | ||
import React, { useContext, useEffect } from 'react'; | ||
|
||
import { ForumContext, ForumContextWrapper } from '../../context/forumContext'; | ||
import { ThreadsView } from '../../layout'; | ||
import { mockedThreads } from '../../shared/mockData'; | ||
|
||
export const Threads = () => { | ||
const { setThreads } = useContext(ForumContext); | ||
|
||
useEffect(() => { | ||
setThreads(mockedThreads); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
return <ThreadsView />; | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.