Skip to content

Commit

Permalink
🚚 refactor: Update "News" to "Tutorials" components
Browse files Browse the repository at this point in the history
Update imports, paths, and labels to reflect the change from "News"
to "Tutorials." This includes renaming files and modifying UI labels
and links to ensure consistency.
  • Loading branch information
Sorok-Dva committed Aug 15, 2024
1 parent ec47c74 commit 85db533
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/components/HomePage/MainBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const MainBanner: React.FC = () => {
C'est parti !
</a>

<Link to="/articles" className="default-btn">
<Link to="/tutorials" className="default-btn">
Voir les tutos
</Link>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layouts/AdminNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ const menus = [
link: '#',
submenu: [
{
label: 'News Grid',
label: 'Tutorials Grid',
link: '/news/',
},
{
label: 'News Right Sidebar',
label: 'Tutorials Right Sidebar',
link: '/news/news-right-sidebar/',
},
{
label: 'News Details',
label: 'Tutorials Details',
link: '/news/news-details/',
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const CommentsArea: React.FC = () => {
{ comments.map((comment) => (
<li key={ comment.id } className="comment">
<div className="comment-body">
<footer className="comment-meta">
<div className="comment-meta">
<div className="comment-author vcard">
<Image
src={ comment.user.avatar }
Expand All @@ -132,7 +132,7 @@ const CommentsArea: React.FC = () => {
<div className="comment-metadata">
<span>{ new Date(comment.createdAt).toLocaleString() }</span>
</div>
</footer>
</div>
<div className="comment-content">
<p>{ comment.content }</p>
</div>
Expand Down
File renamed without changes.
42 changes: 0 additions & 42 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,6 @@ const ProgressTracker = styled.div`
border-radius: 8px;
`

const ArticleItem = styled.div`
margin-bottom: 1rem;
padding: 1rem;
background-color: #fff;
border-radius: 8px;
`

const NotificationItem = styled.div`
margin-bottom: 1rem;
padding: 1rem;
background-color: #fff;
border-radius: 8px;
`

const HomePage = () => {
const { token } = useAuth()
const [dream, setDream] = useState<Dream>()
Expand Down Expand Up @@ -147,12 +133,6 @@ const HomePage = () => {

</TutorialItem>
))}
<TutorialItem>
<p>Maîtriser le rêve lucide en 7 jours</p>
</TutorialItem>
<TutorialItem>
<p>Comprendre les symboles oniriques</p>
</TutorialItem>
<Link to="/tutorials" className="btn btn-outline-primary">
Voir tous les tutoriels
</Link>
Expand All @@ -178,28 +158,6 @@ const HomePage = () => {
</ProgressTracker>
<Link to="/objectifs">Voir tous les objectifs</Link>
</Section>

<Section>
<SectionTitle>Articles Récents</SectionTitle>
<ArticleItem>
<p>Interpréter vos rêves: Guide complet</p>
</ArticleItem>
<ArticleItem>
<p>Comment se souvenir de ses rêves</p>
</ArticleItem>
<Link to="/articles">Voir tous les articles</Link>
</Section>

<Section>
<SectionTitle>Notifications</SectionTitle>
<NotificationItem>
<p>Vous avez un nouveau commentaire sur votre rêve partagé.</p>
</NotificationItem>
<NotificationItem>
<p>Nouveau message dans votre boîte de réception.</p>
</NotificationItem>
<Link to="/notifications">Voir toutes les notifications</Link>
</Section>
</GridContainer>
</DashboardContainer>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import MainBanner from '../components/LandingPage/MainBanner'
import Services from '../components/LandingPage/Services'
import Newsletter from '../components/Common/Newsletter'
import News from '../components/Common/News'
import News from 'components/Common/LastTutorials'
const LandingPage : React.FC = () => {

return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Tutorial.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'
import '../styles/Tutorial.css'
import React, { useEffect, useState } from 'react'
import NewsSidebar from 'components/News/TutorialsSidebar'
import NewsSidebar from 'components/Tutorials/TutorialsSidebar'
import { Link, useParams } from 'react-router-dom'
import CommentsArea from '../components/News/CommentsArea'
import CommentsArea from '../components/Tutorials/CommentsArea'
import { Img as Image } from 'react-image'

import { type Tutorial } from 'pages/Tutorials'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Tutorials.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import React, { useEffect, useState } from 'react'
import TutorialsSidebar from 'components/News/TutorialsSidebar'
import TutorialsSidebar from 'components/Tutorials/TutorialsSidebar'
import { Link } from 'react-router-dom'
import { Img as Image } from 'react-image'
import PageBanner from 'components/Common/PageBanner'
Expand Down

0 comments on commit 85db533

Please sign in to comment.