Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
NextJs-Blog
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Madhankumar
NextJs-Blog
Commits
21b7a064
Commit
21b7a064
authored
a year ago
by
Madhankumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blog list height issue resolved
parent
f3ac5a1c
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
262 additions
and
145 deletions
+262
-145
preview.js
.storybook/preview.js
+0
-4
_app.js
app/_app.js
+7
-10
card.module.css
app/components/base/card/card.module.css
+19
-10
page.js
app/components/base/card/page.js
+28
-14
page.js
app/components/base/header/page.js
+9
-13
icons.module.css
app/components/base/icons/icons.module.css
+3
-1
search.module.css
app/components/base/search/search.module.css
+3
-3
blog-lists.module.css
app/components/top-level/blog-lists/blog-lists.module.css
+7
-1
page.js
app/components/top-level/blog-lists/page.js
+9
-10
page.js
app/components/top-level/pagination/page.js
+9
-4
pagination.module.css
app/components/top-level/pagination/pagination.module.css
+5
-4
page.js
app/components/top-level/single-blog/page.js
+10
-10
single-blog.module.css
app/components/top-level/single-blog/single-blog.module.css
+2
-2
index.js
app/context/index.js
+42
-0
themecontext.js
app/context/themecontext.js
+0
-13
globals.css
app/globals.css
+14
-4
layout.js
app/layout.js
+10
-5
jsconfig.json
jsconfig.json
+2
-1
blog-lists.stories.js
stories/blog-lists.stories.js
+53
-25
card.stories.js
stories/card.stories.js
+8
-4
header.stories.js
stories/header.stories.js
+13
-1
pagination.stories.js
stories/pagination.stories.js
+1
-1
single-blog.stories.js
stories/single-blog.stories.js
+8
-5
No files found.
.storybook/preview.js
View file @
21b7a064
...
...
@@ -2,10 +2,6 @@
import
"../app/globals.css"
;
import
{
useDarkMode
}
from
"storybook-dark-mode"
;
import
"@fortawesome/fontawesome-svg-core/styles.css"
;
// Import the CSS
import
{
library
}
from
"@fortawesome/fontawesome-svg-core"
;
import
{
faNewspaper
}
from
"@fortawesome/free-solid-svg-icons"
;
library
.
add
(
faNewspaper
);
const
preview
=
{
parameters
:
{
...
...
This diff is collapsed.
Click to expand it.
app/_app.js
View file @
21b7a064
import
"@styles/global.css"
;
import
"@fortawesome/fontawesome-svg-core/styles.css"
;
// Import the CSS
import
{
library
}
from
"@fortawesome/fontawesome-svg-core"
;
import
{
faNewspaper
}
from
"@fortawesome/free-solid-svg-icons"
;
library
.
add
(
faNewspaper
);
//import Layout from '../components/layout'
// import "@fortawesome/fontawesome-svg-core/styles.css"; // Import the CSS
// import { library } from "@fortawesome/fontawesome-svg-core";
// import { faNewspaper } from "@fortawesome/free-solid-svg-icons";
// library.add(faNewspaper);
export
default
function
App
({
Component
,
pageProps
})
{
return
(
<>
<
Component
{...
pageProps
}
/
>
<
/
>
);
return
<
Component
{...
pageProps
}
/>
;
}
This diff is collapsed.
Click to expand it.
app/components/base/card/card.module.css
View file @
21b7a064
...
...
@@ -9,34 +9,43 @@
.card
{
background-color
:
var
(
--card-bg
);
border-radius
:
20px
;
/* transition: transform 0.5s; */
display
:
flex
;
flex-direction
:
column
;
transition
:
all
0.3s
ease-in-out
;
word-wrap
:
break-word
;
}
/* .card:hover {
transform: scale(1.1);
} */
.cardbottom
img
{
border-radius
:
50%
;
max-width
:
100%
;
.card
:hover
{
transform
:
translateY
(
-10px
);
}
.card-content
{
padding
:
1.5rem
;
padding-bottom
:
1rem
;
word-wrap
:
break-word
;
}
.authordescription
>
p
{
font-size
:
18px
;
font-weight
:
500
;
}
.cardbottom
{
display
:
grid
;
grid-template-columns
:
0.5
fr
2
fr
;
line-height
:
0
;
align-items
:
start
;
align-items
:
center
;
grid-gap
:
16px
;
color
:
var
(
--font-color-900
);
}
.cardbottom
img
{
border-radius
:
50%
;
height
:
auto
;
max-width
:
100%
;
}
.description
{
color
:
var
(
--font-color-300
);
line-height
:
1.5em
;
font-weight
:
600px
;
word-wrap
:
break-word
;
}
...
...
This diff is collapsed.
Click to expand it.
app/components/base/card/page.js
View file @
21b7a064
...
...
@@ -5,34 +5,43 @@ import Icons from "../icons/page";
import
PropTypes
from
"prop-types"
;
const
Card
=
({
mainT
itle
,
t
itle
,
description
,
imageUrl
,
p
ost
edOn
,
blogImage
,
p
ublish
edOn
,
author
,
readingTime
,
})
=>
{
console
.
log
(
blogImage
);
return
(
<
div
className
=
{
styles
.
card
}
>
<
Link
prefetch
=
{
false
}
href
=
"#"
>
<
Image
className
=
{
styles
.
img
}
src
=
{
imageUrl
}
alt
=
"cardimage"
/>
<
Image
className
=
{
styles
.
img
}
src
=
{
blogImage
.
image
}
height
=
{
blogImage
.
height
}
width
=
{
blogImage
.
width
}
quality
=
{
100
}
alt
=
"cardimage"
/>
<
/Link
>
<
div
className
=
{
styles
[
"card-content"
]}
>
<
Link
prefetch
=
{
false
}
href
=
"#"
className
=
{
styles
.
title
}
>
{
mainTitle
}
<
p
>
{
title
}
<
/p
>
<
/Link
>
<
p
className
=
{
styles
.
description
}
>
{
description
}
<
/p
>
<
div
className
=
{
styles
.
authorcontainer
}
>
<
div
className
=
{
styles
.
cardbottom
}
>
<
Image
className
=
{
styles
.
img
}
src
=
{
author
.
authImg
}
src
=
{
author
.
image
}
quality
=
{
100
}
alt
=
"authorImg"
/>
<
div
>
<
h3
>
{
author
.
name
}
<
/h3
>
<
div
className
=
{
styles
.
authordescription
}
>
<
p
>
{
author
.
name
}
<
/p
>
<
div
className
=
{
styles
[
"author-desc"
]}
>
{
post
edOn
}
{
publish
edOn
}
<
span
className
=
{
styles
.
icon
}
>
<
Icons
name
=
"clock"
/>
{
readingTime
}
...
...
@@ -42,18 +51,23 @@ const Card = ({
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
Card
.
propTypes
=
{
mainT
itle
:
PropTypes
.
string
,
t
itle
:
PropTypes
.
string
,
description
:
PropTypes
.
string
,
imageUrl
:
PropTypes
.
object
,
postedOn
:
PropTypes
.
string
,
blogImage
:
PropTypes
.
shape
({
image
:
PropTypes
.
string
,
height
:
PropTypes
.
number
,
width
:
PropTypes
.
number
,
}),
publishedon
:
PropTypes
.
string
,
author
:
PropTypes
.
shape
({
name
:
PropTypes
.
string
,
authImg
:
PropTypes
.
string
,
// Use PropTypes.string for authImg
image
:
PropTypes
.
string
,
// Use PropTypes.string for images
}),
postedOn
:
PropTypes
.
string
,
readingTime
:
PropTypes
.
string
,
};
...
...
This diff is collapsed.
Click to expand it.
app/components/base/header/page.js
View file @
21b7a064
import
styles
from
"./header.module.css"
;
import
Search
from
"../search/page"
;
import
Icon
from
"../icons/page"
;
import
{
use
State
}
from
"reac
t"
;
import
{
FontAwesomeIcon
}
from
"@fortawesome/react-fontawesome"
;
// Correct
import
{
use
Theme
}
from
"../../../contex
t"
;
import
Link
from
"next/link"
;
function
Header
({
onThemeChange
,
onSearch
,
onClose
})
{
const
[
theme
,
setTheme
]
=
useState
(
"light"
);
function
Header
({
name
,
onThemeChange
,
onSearch
,
onClose
})
{
const
{
theme
,
toggleTheme
}
=
useTheme
(
);
const
handleTheme
=
()
=>
{
t
heme
==
"light"
?
setTheme
(
"dark"
)
:
setTheme
(
"light"
);
t
oggleTheme
(
);
onThemeChange
(
theme
);
};
const
handleSearch
=
(
value
)
=>
{
...
...
@@ -21,21 +21,17 @@ function Header({ onThemeChange, onSearch, onClose }) {
<
header
className
=
{
styles
.
header
}
>
<
div
className
=
{
styles
.
container
}
>
<
nav
className
=
{
styles
.
navbar
}
>
<
a
className
=
{
styles
[
"navbar-brand"
]}
href
=
"/"
>
{
/* <FontAwesomeIcon
icon="fa fa-newspaper"
style={{ fontSize: "30px", color: "#5a67d8" }}
/> */
}
<
Link
className
=
{
styles
[
"navbar-brand"
]}
href
=
"/"
prefetch
=
{
false
}
>
<
Icon
name
=
"newspaper"
/>
<
h2
>
NewsBlog
<
/h2
>
<
/
a
>
<
h2
>
{
name
}
<
/h2
>
<
/
Link
>
<
div
className
=
{
styles
.
search
}
>
<
Search
onSearch
=
{
handleSearch
}
onClose
=
{
handleClose
}
/
>
<
/div
>
<
div
onClick
=
{
handleTheme
}
className
=
{
styles
.
themelight
}
>
<
Icon
name
=
{
theme
==
"
dark
"
?
"moon"
:
"sun"
}
/
>
<
Icon
name
=
{
theme
==
"
light
"
?
"moon"
:
"sun"
}
/
>
<
span
className
=
{
styles
.
mobilemenu
}
>
<
Icon
name
=
"hamburger"
/>
<
/span
>
...
...
This diff is collapsed.
Click to expand it.
app/components/base/icons/icons.module.css
View file @
21b7a064
...
...
@@ -10,7 +10,7 @@
.sun
svg
{
height
:
35px
;
width
:
35px
;
color
:
var
(
--font-color-
9
00
);
color
:
var
(
--font-color-
3
00
);
vertical-align
:
sub
;
}
...
...
@@ -19,6 +19,8 @@
color
:
white
;
padding
:
0.5rem
0.7rem
;
border-radius
:
5px
;
height
:
35px
;
width
:
35px
;
}
.newspaper
svg
{
...
...
This diff is collapsed.
Click to expand it.
app/components/base/search/search.module.css
View file @
21b7a064
...
...
@@ -2,16 +2,16 @@
height
:
48px
;
width
:
30vw
;
background
:
#f4f4f4
;
border-radius
:
10px
;
border
:
none
;
outline
:
3px
solid
var
(
--card-bg
);
outline
:
none
;
padding-left
:
3rem
;
font-size
:
16px
;
}
.search-input
{
position
:
relative
;
display
:
inline-block
;
border-radius
:
2px
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.16
)
0px
1px
4px
;
}
.search-icon
{
position
:
absolute
;
...
...
This diff is collapsed.
Click to expand it.
app/components/top-level/blog-lists/blog-lists.module.css
View file @
21b7a064
.blog
list
-container
{
.blog-container
{
max-width
:
1200px
;
margin
:
0
auto
;
}
...
...
@@ -7,6 +7,12 @@
grid-row-gap
:
3rem
;
}
.card-container
{
display
:
flex
;
align-self
:
normal
;
flex
:
1
0
auto
;
}
.title
{
font-size
:
38px
;
line-height
:
25px
;
...
...
This diff is collapsed.
Click to expand it.
app/components/top-level/blog-lists/page.js
View file @
21b7a064
import
PropTypes
from
"prop-types"
;
import
Card
from
"../../base/card/page"
;
import
styles
from
"./blog-lists.module.css"
;
const
BlogLists
=
({
listsData
})
=>
{
const
BlogLists
=
({
title
,
description
,
blogs
})
=>
{
return
(
<
div
className
=
{
styles
[
"bloglist-container"
]}
>
<
h1
className
=
{
styles
.
title
}
>
Lifestyle
<
/h1
>
<
p
className
=
{
styles
.
description
}
>
Lorem
ipsum
dolor
sit
amet
elit
.
Id
quaerat
amet
ipsum
sunt
et
quos
dolorum
<
/p
>
<
div
className
=
{
styles
[
"blog-container"
]}
>
<
h1
className
=
{
styles
.
title
}
>
{
title
}
<
/h1
>
<
p
className
=
{
styles
.
description
}
>
{
description
}
<
/p
>
<
div
className
=
{
styles
.
row
}
>
{
listsData
.
map
((
blogData
,
i
)
=>
(
<
Card
key
=
{
i
}
{...
blogData
}
/
>
{
blogs
.
map
((
blogData
,
i
)
=>
(
<
div
key
=
{
i
}
className
=
{
styles
[
"card-container"
]}
>
<
Card
{...
blogData
}
/
>
<
/div
>
))}
<
/div
>
<
/div
>
);
};
BlogLists
.
propTypes
=
{
listsData
:
PropTypes
.
array
,
blogs
:
PropTypes
.
array
,
};
export
default
BlogLists
;
This diff is collapsed.
Click to expand it.
app/components/top-level/pagination/page.js
View file @
21b7a064
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
styles
from
"./pagination.module.css"
;
import
PropTypes
from
"prop-types"
;
function
Pagination
({
total
Pages
,
currentPage
,
onPageChange
})
{
function
Pagination
({
total
,
currentPage
,
onPageChange
})
{
//Set number of pages
const
numberOfPages
=
[];
for
(
let
i
=
1
;
i
<=
totalPages
;
i
++
)
{
const
totalPage
=
total
<=
1
?
1
:
total
;
for
(
let
i
=
1
;
i
<=
totalPage
;
i
++
)
{
numberOfPages
.
push
(
i
);
}
...
...
@@ -14,7 +16,6 @@ function Pagination({ totalPages, currentPage, onPageChange }) {
// Array of buttons what we see on the page
const
[
arrOfCurrButtons
,
setArrOfCurrButtons
]
=
useState
([]);
useEffect
(()
=>
{
console
.
log
(
"diyd"
,
currentPage
);
let
tempNumberOfPages
=
[...
arrOfCurrButtons
];
let
dotsInitial
=
"..."
;
...
...
@@ -47,7 +48,7 @@ function Pagination({ totalPages, currentPage, onPageChange }) {
}
setArrOfCurrButtons
(
tempNumberOfPages
);
},
[
total
Pages
,
currentButton
]);
},
[
total
,
currentButton
]);
//update currentButton value if currentPageNo changes
useEffect
(()
=>
{
...
...
@@ -100,4 +101,8 @@ function Pagination({ totalPages, currentPage, onPageChange }) {
);
}
Pagination
.
propTypes
=
{
total
:
PropTypes
.
number
.
isRequired
,
currentPage
:
PropTypes
.
number
,
};
export
default
Pagination
;
This diff is collapsed.
Click to expand it.
app/components/top-level/pagination/pagination.module.css
View file @
21b7a064
...
...
@@ -24,8 +24,9 @@
}
.pagination-container
a
.active
{
background-color
:
var
(
--primary-color
);
color
:
white
;
background
:
#5a67d8
;
color
:
#fff
;
border
:
1px
solid
#7cbddb
;
border-radius
:
10px
;
font-size
:
14px
;
...
...
@@ -37,8 +38,8 @@
cursor
:
not-allowed
;
}
.pagination-container
a
:hover:not
(
.active
)
{
background
-color
:
var
(
--primary-color
)
;
color
:
white
;
background
:
#5a67d8
;
color
:
#fff
;
}
.next
{
...
...
This diff is collapsed.
Click to expand it.
app/components/top-level/single-blog/page.js
View file @
21b7a064
...
...
@@ -3,20 +3,20 @@ import styles from "./single-blog.module.css";
import
ReactMarkdown
from
"react-markdown"
;
import
remarkGfm
from
"remark-gfm"
;
function
SingleBlog
({
subT
itle
,
t
itle
,
postedOn
,
author
Name
,
publishedIn
,
author
,
category
,
readTime
,
blogImg
,
tag
s
,
categorie
s
,
markdown
,
})
{
return
(
<>
<
div
className
=
{
styles
[
"head-container"
]}
>
<
div
className
=
{
styles
.
headtitle
}
>
<
h1
className
=
{
styles
.
title
}
>
{
subT
itle
}
<
/h1
>
<
h1
className
=
{
styles
.
title
}
>
{
t
itle
}
<
/h1
>
<
/div
>
<
div
className
=
{
styles
[
"blog-list"
]}
>
<
ul
>
...
...
@@ -26,13 +26,13 @@ function SingleBlog({
<
li
>
By
&
nbsp
;
<
a
href
=
"#"
className
=
{
styles
[
"list-bold"
]}
>
{
author
N
ame
}
{
author
?.
n
ame
}
<
/a
>
<
/li
>
<
li
>
Published
in
&
nbsp
;
<
a
href
=
"#"
className
=
{
styles
[
"list-bold"
]}
>
{
publishedIn
}
{
category
}
<
/a
>
<
/li
>
<
li
>
...
...
@@ -47,7 +47,7 @@ function SingleBlog({
<
div
className
=
{
styles
.
blogimage
}
>
<
Image
className
=
{
styles
.
img
}
src
=
{
blogImg
}
src
=
{
author
?.
image
}
quality
=
{
100
}
alt
=
"image"
/>
...
...
@@ -55,8 +55,8 @@ function SingleBlog({
<
div
className
=
{
styles
[
"blog-content"
]}
>
<
ReactMarkdown
remarkPlugins
=
{[
remarkGfm
]}
>
{
markdown
}
<
/ReactMarkdown
>
<
div
className
=
{
styles
.
tag
}
>
<
h3
>
Tag
:
<
/h3
>
{
tag
s
.
map
((
e
,
i
)
=>
(
<
h3
>
Tag
s
:
<
/h3
>
{
categorie
s
.
map
((
e
,
i
)
=>
(
<
p
key
=
{
i
}
>
{
e
}
<
/p
>
))}
<
/div
>
...
...
This diff is collapsed.
Click to expand it.
app/components/top-level/single-blog/single-blog.module.css
View file @
21b7a064
...
...
@@ -92,7 +92,7 @@ blockquote p::before {
/* padding-inline: 1rem; */
}
.title
{
font-size
:
clamp
(
1rem
,
1.3rem
+
2
.5vw
,
3.4
rem
);
font-size
:
clamp
(
1rem
,
1.3rem
+
2
vw
,
3
rem
);
margin
:
0
;
font-weight
:
600
;
color
:
var
(
--font-color-900
);
...
...
@@ -105,7 +105,7 @@ h3 {
color
:
var
(
--font-color-900
);
}
h2
{
font-size
:
clamp
(
1rem
,
1rem
+
2vw
,
2
rem
);
font-size
:
clamp
(
1rem
,
1rem
+
2vw
,
1.7
rem
);
}
@media
(
min-width
:
802px
)
{
.blog-content
{
...
...
This diff is collapsed.
Click to expand it.
app/context/index.js
0 → 100644
View file @
21b7a064
import
React
,
{
createContext
,
useState
,
useContext
,
useEffect
}
from
"react"
;
import
{
useDarkMode
}
from
"storybook-dark-mode"
;
const
ThemeContext
=
createContext
();
export
const
ThemeProvider
=
({
children
})
=>
{
const
isDarkMode
=
useDarkMode
();
const
[
theme
,
setTheme
]
=
useState
(
"light"
);
const
toggleTheme
=
()
=>
{
setTheme
((
prevTheme
)
=>
(
prevTheme
===
"light"
?
"dark"
:
"light"
));
};
useEffect
(()
=>
{
// You can use localStorage to persist the theme preference
const
savedTheme
=
localStorage
.
getItem
(
"theme"
);
setTheme
((
isDarkMode
?
"dark"
:
"light"
)
||
savedTheme
);
},
[
isDarkMode
]);
useEffect
(()
=>
{
document
.
documentElement
.
setAttribute
(
"data-theme"
,
theme
);
localStorage
.
setItem
(
"theme"
,
theme
);
},
[
theme
]);
return
(
<
ThemeContext
.
Provider
value
=
{{
theme
,
toggleTheme
}}
>
{
children
}
<
/ThemeContext.Provider
>
);
};
export
const
useTheme
=
()
=>
{
const
context
=
useContext
(
ThemeContext
);
if
(
!
context
)
{
throw
new
Error
(
"useTheme must be used within a ThemeProvider"
);
}
return
context
;
};
export
const
decorators
=
[
(
renderStory
)
=>
<
ThemeProvider
>
{
renderStory
()}
<
/ThemeProvider>
,
];
This diff is collapsed.
Click to expand it.
app/context/themecontext.js
deleted
100644 → 0
View file @
f3ac5a1c
import
{
ThemeProvider
}
from
"next-themes"
;
import
{
useDarkMode
}
from
"storybook-dark-mode"
;
export
function
Providers
({
children
})
{
return
(
<
ThemeProvider
value
=
{
useDarkMode
()
?
darkTheme
:
defaultTheme
}
>
{
children
}
<
/ThemeProvider
>
);
}
export
const
decorators
=
[
(
renderStory
)
=>
<
Providers
>
{
renderStory
()}
<
/Providers>
,
];
This diff is collapsed.
Click to expand it.
app/globals.css
View file @
21b7a064
@import
url("//fonts.googleapis.com/css2?family=Hind:wght@300;400;500;600&display=swap")
;
@import
url("//fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&display=swap")
;
*
{
box-sizing
:
border-box
;
font-family
:
-apple-system
,
BlinkMacSystemFont
,
"Segoe UI"
,
Roboto
,
Oxygen-Sans
,
Ubuntu
,
Cantarell
,
"Helvetica Neue"
,
sans-serif
;
}
.light
{
--primary-color
:
#5a67d8
;
--secondary-color
:
#463373
;
--font-color-900
:
#
718096
;
--font-color-900
:
#
2d3748
;
--font-color-300
:
#718096
;
--title-color
:
#2d3748
;
--bg-color
:
#f
4f4f4
;
--bg-color
:
#f
8f9fa
;
--card-bg
:
#fff
;
--heading-color
:
#2d3748
;
--border-radius
:
6px
;
...
...
@@ -25,6 +34,7 @@
--font-color-900
:
#fff
;
--title-color
:
#fff
;
--font-color-700
:
#fff
;
--primary-color
:
#fff
;
}
body
,
...
...
@@ -38,12 +48,12 @@ html {
margin
:
0
auto
;
color
:
#718096
;
font-family
:
-apple-system
,
BlinkMacSystemFont
,
"Segoe UI"
,
Roboto
,
Oxygen-Sans
,
Ubuntu
,
Cantarell
,
"Helvetica Neue"
,
sans-serif
;
"Helvetica Neue"
,
Arial
,
"Noto Sans"
,
sans-serif
,
"Apple Color Emoji"
,
"Segoe UI Emoji"
,
"Segoe UI Symbol"
,
"Noto Color Emoji"
;
}
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
...
...
This diff is collapsed.
Click to expand it.
app/layout.js
View file @
21b7a064
import
{
Inter
}
from
"next/font/google"
;
import
"./globals.css"
;
import
{
useTheme
,
ThemeProvider
}
from
"./context"
;
import
{
useEffect
}
from
"react"
;
const
inter
=
Inter
({
subsets
:
[
"latin"
]
});
import
{
Providers
}
from
"../app/context/themecontext"
;
export
const
metadata
=
{
title
:
"Home"
,
...
...
@@ -10,11 +11,15 @@ export const metadata = {
};
export
default
function
RootLayout
({
children
})
{
const
{
theme
}
=
useTheme
();
useEffect
(()
=>
{
console
.
log
(
"Theme in RootLayout:"
,
theme
);
},
[
theme
]);
return
(
<
html
lang
=
"en"
>
<
body
className
=
{
inter
.
className
}
>
<
Providers
>
{
children
}
<
/Providers
>
<
/body
>
<
ThemeProvider
>
<
html
lang
=
"en"
className
=
{
theme
}
>
<
body
>
{
children
}
<
/body
>
<
/html
>
<
/ThemeProvider
>
);
}
This diff is collapsed.
Click to expand it.
jsconfig.json
View file @
21b7a064
{
"compilerOptions"
:
{
"paths"
:
{
"@/*"
:
[
"./*"
]
"@/*"
:
[
"./*"
],
}
}
}
This diff is collapsed.
Click to expand it.
stories/blog-lists.stories.js
View file @
21b7a064
...
...
@@ -7,76 +7,104 @@ export default {
export
const
blogLists
=
(
args
)
=>
<
BlogLists
{...
args
}
/>
;
blogLists
.
args
=
{
listsData
:
[
title
:
"Lifestyle"
,
description
:
"Lorem ipsum dolor sit amet elit. Id quaerat amet ipsum sunt et quos dolorum"
,
blogs
:
[
{
mainT
itle
:
"How to get perfect start for beginning runners"
,
t
itle
:
"How to get perfect start for beginning runners"
,
description
:
"Lorem ipsum dolor sit amet consectetur ipsum adipisicing elit. Quis vitae sit."
,
imageUrl
:
require
(
"../public/images/lifestyle1.jpg"
),
postedOn
:
"July 13, 2020."
,
blogImage
:
{
image
:
require
(
"../public/images/lifestyle1.jpg"
),
height
:
490
,
width
:
740
,
},
publishedOn
:
"July 13, 2020."
,
author
:
{
name
:
"Isabella ava"
,
authImg
:
require
(
"../public/images/a1.jpg"
),
image
:
require
(
"../public/images/a1.jpg"
),
},
readingTime
:
"1min"
,
},
{
mainT
itle
:
"Great tools to improve your personal blogging experience"
,
t
itle
:
"Great tools to improve your personal blogging experience"
,
description
:
"Lorem ipsum dolor sit amet consectetur ipsum adipisicing elit. Quis vitae sit."
,
imageUrl
:
require
(
"../public/images/lifestyle2.jpg"
),
postedOn
:
"July 13, 2020."
,
blogImage
:
{
image
:
require
(
"../public/images/lifestyle2.jpg"
),
height
:
490
,
width
:
740
,
},
publishedOn
:
"July 13, 2020."
,
author
:
{
name
:
"Charlotte mia"
,
authImg
:
require
(
"../public/images/a2.jpg"
),
image
:
require
(
"../public/images/a2.jpg"
),
},
readingTime
:
"1min"
,
},
{
mainT
itle
:
"Blog Guide: How to Start a Personal blog on WordPress"
,
t
itle
:
"Blog Guide: How to Start a Personal blog on WordPress"
,
description
:
"Lorem ipsum dolor sit amet consectetur ipsum adipisicing elit. Quis vitae sit."
,
imageUrl
:
require
(
"../public/images/lifestyle3.jpg"
),
postedOn
:
"July 13, 2020."
,
blogImage
:
{
image
:
require
(
"../public/images/lifestyle3.jpg"
),
height
:
490
,
width
:
740
,
},
publishedOn
:
"July 13, 2020."
,
author
:
{
name
:
"Elizabeth"
,
authImg
:
require
(
"../public/images/a3.jpg"
),
image
:
require
(
"../public/images/a3.jpg"
),
},
readingTime
:
"1min"
,
},
{
mainT
itle
:
"The technical setup when starting a personal blog"
,
t
itle
:
"The technical setup when starting a personal blog"
,
description
:
"Lorem ipsum dolor sit amet consectetur ipsum adipisicing elit. Quis vitae sit."
,
imageUrl
:
require
(
"../public/images/lifestyle4.jpg"
),
postedOn
:
"July 13, 2020."
,
blogImage
:
{
image
:
require
(
"../public/images/lifestyle4.jpg"
),
height
:
490
,
width
:
740
,
},
publishedOn
:
"July 13, 2020."
,
author
:
{
name
:
"Charlotte mia"
,
authImg
:
require
(
"../public/images/a1.jpg"
),
image
:
require
(
"../public/images/a1.jpg"
),
},
readingTime
:
"1min"
,
},
{
mainT
itle
:
"3 New outfit Formulas To Add to your Capsule Wardrobe"
,
t
itle
:
"3 New outfit Formulas To Add to your Capsule Wardrobe"
,
description
:
"Lorem ipsum dolor sit amet consectetur ipsum adipisicing elit. Quis vitae sit."
,
imageUrl
:
require
(
"../public/images/lifestyle5.jpg"
),
postedOn
:
"July 13, 2020."
,
blogImage
:
{
image
:
require
(
"../public/images/lifestyle5.jpg"
),
height
:
490
,
width
:
740
,
},
publishedOn
:
"July 13, 2020."
,
author
:
{
name
:
"Elizabeth"
,
authImg
:
require
(
"../public/images/a3.jpg"
),
image
:
require
(
"../public/images/a3.jpg"
),
},
readingTime
:
"1min"
,
},
{
mainT
itle
:
"3 New outfit Formulas To Add to your Capsule Wardrobe"
,
t
itle
:
"3 New outfit Formulas To Add to your Capsule Wardrobe"
,
description
:
"Lorem ipsum dolor sit amet consectetur ipsum adipisicing elit. Quis vitae sit."
,
imageUrl
:
require
(
"../public/images/lifestyle6.jpg"
),
postedOn
:
"July 13, 2020."
,
blogImage
:
{
image
:
require
(
"../public/images/lifestyle6.jpg"
),
height
:
490
,
width
:
740
,
},
publishedOn
:
"July 13, 2020."
,
author
:
{
name
:
"Isabella ava"
,
authImg
:
require
(
"../public/images/a1.jpg"
),
image
:
require
(
"../public/images/a1.jpg"
),
},
readingTime
:
"1min"
,
},
...
...
This diff is collapsed.
Click to expand it.
stories/card.stories.js
View file @
21b7a064
...
...
@@ -8,14 +8,18 @@ export default {
};
export
const
card
=
(
args
)
=>
<
Card
{...
args
}
/>
;
card
.
args
=
{
mainT
itle
:
"How to get a perfect start for beginning runners"
,
t
itle
:
"How to get a perfect start for beginning runners"
,
description
:
"Lorem ipsum dolor sit amet consectetur ipsum adipisicing elit. Quis vitae sit."
,
imageUrl
:
require
(
"../public/images/lifestyle1.jpg"
),
// Use require to load images
postedOn
:
"July 13, 2020."
,
blogImage
:
{
image
:
require
(
"../public/images/lifestyle1.jpg"
),
height
:
490
,
width
:
740
,
},
publishedOn
:
"July 13, 2020."
,
author
:
{
name
:
"Isabella Ava"
,
authImg
:
require
(
"../public/images/a1.jpg"
),
// Use require to load images
image
:
require
(
"../public/images/a1.jpg"
),
// Use require to load images
},
readingTime
:
"1 min"
,
};
This diff is collapsed.
Click to expand it.
stories/header.stories.js
View file @
21b7a064
import
Header
from
"../app/components/base/header/page"
;
import
{
ThemeProvider
}
from
"../app/context"
;
export
default
{
title
:
"Base/Header"
,
component
:
Header
,
decorators
:
[
(
Story
)
=>
(
<
ThemeProvider
>
<
Story
/>
<
/ThemeProvider
>
),
],
argTypes
:
{
onThemeChange
:
{
actions
:
"onThemeChange"
},
onSearch
:
{
actions
:
"onSearch"
},
...
...
@@ -9,4 +17,8 @@ export default {
},
};
export
const
header
=
{};
export
const
header
=
{
args
:
{
name
:
"NewsBlog"
,
},
};
This diff is collapsed.
Click to expand it.
stories/pagination.stories.js
View file @
21b7a064
...
...
@@ -9,7 +9,7 @@ export default {
export
const
pagination
=
{
args
:
{
total
Pages
:
10
,
total
:
10
,
currentPage
:
1
,
},
};
This diff is collapsed.
Click to expand it.
stories/single-blog.stories.js
View file @
21b7a064
...
...
@@ -7,13 +7,16 @@ export default {
export
const
singleBlog
=
(
args
)
=>
<
SingleBlog
{...
args
}
/>
;
singleBlog
.
args
=
{
subT
itle
:
"Create an Art that shows the beauty in everyone ideas of flaws."
,
t
itle
:
"Create an Art that shows the beauty in everyone ideas of flaws."
,
postedOn
:
"July 11,2020"
,
authorName
:
"Charlotte mia"
,
publishedIn
:
"Fashion"
,
author
:
{
name
:
"Charlotte mia"
,
image
:
require
(
"../public/images/blogsingle.jpg"
),
},
category
:
"Fashion"
,
readTime
:
"1 min read"
,
tags
:
[
"Fashion"
,
"Beauty"
],
blogImg
:
require
(
"../public/images/blogsingle.jpg"
),
categories
:
[
"Fashion"
,
"Beauty"
],
markdown
:
`
## How to create an Art that shows the beauty in everyone ideas of flaws.
...
...
This diff is collapsed.
Click to expand it.
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