mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
🔥 remove: link in collapse title
:%s
This commit is contained in:
@@ -106,7 +106,6 @@ const COLLAPSE_DATA = [
|
|||||||
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
||||||
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
||||||
],
|
],
|
||||||
link: "/title"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "This is a subtitle",
|
title: "This is a subtitle",
|
||||||
@@ -115,7 +114,6 @@ const COLLAPSE_DATA = [
|
|||||||
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
||||||
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
||||||
],
|
],
|
||||||
link: "/title"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "This is a subtitle",
|
title: "This is a subtitle",
|
||||||
@@ -124,7 +122,6 @@ const COLLAPSE_DATA = [
|
|||||||
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
||||||
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
||||||
],
|
],
|
||||||
link: "/title"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "This is a subtitle",
|
title: "This is a subtitle",
|
||||||
@@ -133,7 +130,6 @@ const COLLAPSE_DATA = [
|
|||||||
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
"Some people aren’t into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
|
||||||
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
|
||||||
],
|
],
|
||||||
link: "/title"
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
export default function Test() {
|
export default function Test() {
|
||||||
|
@@ -2,15 +2,13 @@ import s from './CollapseChild.module.scss'
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import CollapseContent from './CollapseContent/CollapseContent'
|
import CollapseContent from './CollapseContent/CollapseContent'
|
||||||
import Link from 'next/link'
|
|
||||||
|
|
||||||
interface CollapseProps{
|
interface CollapseProps{
|
||||||
title?: string,
|
title?: string,
|
||||||
content: Array<string>,
|
content: Array<string>,
|
||||||
isToggle?: boolean,
|
isToggle?: boolean,
|
||||||
link?: string,
|
|
||||||
}
|
}
|
||||||
const CollapseChild = ({title, content, isToggle=false, link="/"}: CollapseProps) => {
|
const CollapseChild = ({title, content, isToggle=false}: CollapseProps) => {
|
||||||
const [isActive, changeActive] = useState(isToggle)
|
const [isActive, changeActive] = useState(isToggle)
|
||||||
|
|
||||||
const handleToggle = () => {
|
const handleToggle = () => {
|
||||||
@@ -24,9 +22,7 @@ const CollapseChild = ({title, content, isToggle=false, link="/"}: CollapseProps
|
|||||||
onClick = { handleToggle }
|
onClick = { handleToggle }
|
||||||
>
|
>
|
||||||
<div className={s.title}>
|
<div className={s.title}>
|
||||||
<Link href={link}>
|
<h4>{title}</h4>
|
||||||
<a>{title}</a>
|
|
||||||
</Link>
|
|
||||||
<div className={s.toggle}></div>
|
<div className={s.toggle}></div>
|
||||||
</div>
|
</div>
|
||||||
<div className={s.contentContainer}>
|
<div className={s.contentContainer}>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import CollapseChild from './CollapseChild/CollapseChild'
|
import CollapseChild from './CollapseChild/CollapseChild'
|
||||||
|
|
||||||
interface CollapseCommonProps{
|
interface CollapseCommonProps{
|
||||||
data: {title: string, content: Array<string>, link: string}[],
|
data: {title: string, content: Array<string>}[],
|
||||||
}
|
}
|
||||||
|
|
||||||
const CollapseCommon = ({data}: CollapseCommonProps) => {
|
const CollapseCommon = ({data}: CollapseCommonProps) => {
|
||||||
@@ -9,7 +9,7 @@ const CollapseCommon = ({data}: CollapseCommonProps) => {
|
|||||||
<section>
|
<section>
|
||||||
{
|
{
|
||||||
data.map(item =>
|
data.map(item =>
|
||||||
<CollapseChild key={item.title} title={item.title} content={item.content} link={item.link} />
|
<CollapseChild key={item.title} title={item.title} content={item.content}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
|
Reference in New Issue
Block a user