Skip to content

Commit b2c8854

Browse files
update fix
1 parent 63e5c44 commit b2c8854

File tree

4 files changed

+14
-89
lines changed

4 files changed

+14
-89
lines changed

frontend/src/components/CardDetailsPage.tsx

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import TitleWithIcon from 'components/TitleWithIcon'
1212
import ToggleableList from 'components/ToggleableList'
1313
import TopContributors from 'components/ToggleContributors'
1414

15-
1615
const DetailsCard = ({
1716
title,
1817
is_active = true,
@@ -40,15 +39,7 @@ const DetailsCard = ({
4039
{!is_active && (
4140
<span className="ml-2 rounded bg-red-200 px-2 py-1 text-sm text-red-800">Inactive</span>
4241
)}
43-
<SecondaryCard
44-
title={
45-
<TitleWithIcon
46-
href="#summary"
47-
icon={faLink}
48-
title="Summary"
49-
/>
50-
}
51-
>
42+
<SecondaryCard title={<TitleWithIcon href="#summary" icon={faLink} title="Summary" />}>
5243
<p>{summary}</p>
5344
</SecondaryCard>
5445

@@ -75,13 +66,7 @@ const DetailsCard = ({
7566
</SecondaryCard>
7667
{(type === 'project' || type === 'repository' || type === 'committee') && (
7768
<SecondaryCard
78-
title={
79-
<TitleWithIcon
80-
href="#statistics"
81-
icon={faLink}
82-
title="Statistics"
83-
/>
84-
}
69+
title={<TitleWithIcon href="#statistics" icon={faLink} title="Statistics" />}
8570
className="md:col-span-2"
8671
>
8772
{stats.map((stat, index) => (
@@ -112,25 +97,13 @@ const DetailsCard = ({
11297
{languages.length !== 0 && (
11398
<ToggleableList
11499
items={languages}
115-
label={
116-
<TitleWithIcon
117-
href="#languages"
118-
icon={faLink}
119-
title="Languages"
120-
/>
121-
}
100+
label={<TitleWithIcon href="#languages" icon={faLink} title="Languages" />}
122101
/>
123102
)}
124103
{topics.length !== 0 && (
125104
<ToggleableList
126105
items={topics}
127-
label={
128-
<TitleWithIcon
129-
href="#topics"
130-
icon={faLink}
131-
title="Topics"
132-
/>
133-
}
106+
label={<TitleWithIcon href="#topics" icon={faLink} title="Topics" />}
134107
/>
135108
)}
136109
</div>
@@ -141,13 +114,7 @@ const DetailsCard = ({
141114
{(type === 'project' || type === 'repository') && (
142115
<>
143116
<ItemCardList
144-
title={
145-
<TitleWithIcon
146-
href="#recent-issues"
147-
icon={faLink}
148-
title="Recent Issues"
149-
/>
150-
}
117+
title={<TitleWithIcon href="#recent-issues" icon={faLink} title="Recent Issues" />}
151118
data={recentIssues}
152119
renderDetails={(item) => (
153120
<div className="mt-2 flex items-center text-sm text-gray-600 dark:text-gray-400">
@@ -160,11 +127,7 @@ const DetailsCard = ({
160127
/>
161128
<ItemCardList
162129
title={
163-
<TitleWithIcon
164-
href="#recent-releases"
165-
icon={faLink}
166-
title="Recent Releases"
167-
/>
130+
<TitleWithIcon href="#recent-releases" icon={faLink} title="Recent Releases" />
168131
}
169132
data={recentReleases}
170133
renderDetails={(item) => (
@@ -180,13 +143,7 @@ const DetailsCard = ({
180143
)}
181144
{type === 'project' && repositories.length > 0 && (
182145
<SecondaryCard
183-
title={
184-
<TitleWithIcon
185-
href="#repositories"
186-
icon={faLink}
187-
title="Repositories"
188-
/>
189-
}
146+
title={<TitleWithIcon href="#repositories" icon={faLink} title="Repositories" />}
190147
className="mt-6"
191148
>
192149
<RepositoriesCard repositories={repositories} />

frontend/src/components/TitleWithIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const TitleWithIcon: React.FC<TitleWithIconProps> = ({ href, icon, title }) => {
2121

2222
return (
2323
<div id={id} className="relative scroll-mt-20">
24-
<div className="group relative flex items-top">
24+
<div className="items-top group relative flex">
2525
<h2 className="mb-4 text-2xl font-semibold">{title}</h2>
2626
<a
2727
href={href}

frontend/src/components/ToggleContributors.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ const TopContributors = ({
3131
}
3232
return (
3333
<div className={`mb-8 rounded-lg bg-gray-100 p-6 shadow-md dark:bg-gray-800 ${className}`}>
34-
<TitleWithIcon
35-
href="#top-contributors"
36-
icon={faLink}
37-
title={label}
38-
/>
34+
<TitleWithIcon href="#top-contributors" icon={faLink} title={label} />
3935
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
4036
{displayContributors.map((contributor, index) => (
4137
<div

frontend/src/pages/Home.tsx

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,7 @@ export default function Home() {
130130
</div>
131131
<div className="grid gap-4 md:grid-cols-2">
132132
<SecondaryCard
133-
title={
134-
<TitleWithIcon
135-
href="#new-chapters"
136-
icon={faLink}
137-
title="New Chapters"
138-
/>
139-
}
133+
title={<TitleWithIcon href="#new-chapters" icon={faLink} title="New Chapters" />}
140134
>
141135
<div className="space-y-4">
142136
{data.recentChapters.map((chapter) => (
@@ -161,13 +155,7 @@ export default function Home() {
161155
</div>
162156
</SecondaryCard>
163157
<SecondaryCard
164-
title={
165-
<TitleWithIcon
166-
href="#new-Projects"
167-
icon={faLink}
168-
title="New Projects"
169-
/>
170-
}
158+
title={<TitleWithIcon href="#new-Projects" icon={faLink} title="New Projects" />}
171159
>
172160
<div className="space-y-4">
173161
{data.recentProjects.map((project) => (
@@ -197,25 +185,15 @@ export default function Home() {
197185
</div>
198186
<TopContributors contributors={data.topContributors} maxInitialDisplay={9} />
199187
<div className="mb-20">
200-
<TitleWithIcon
201-
href="#chapters-nearby"
202-
icon={faLink}
203-
title="OWASP Chapters Nearby"
204-
/>
188+
<TitleWithIcon href="#chapters-nearby" icon={faLink} title="OWASP Chapters Nearby" />
205189
<ChapterMap
206190
geoLocData={geoLocData}
207191
style={{ height: '400px', width: '100%', zIndex: '0' }}
208192
/>
209193
</div>
210194
<div className="grid gap-4 md:grid-cols-2">
211195
<ItemCardList
212-
title={
213-
<TitleWithIcon
214-
href="#recent-issues"
215-
icon={faLink}
216-
title="Recent Issues"
217-
/>
218-
}
196+
title={<TitleWithIcon href="#recent-issues" icon={faLink} title="Recent Issues" />}
219197
data={data.recentIssues}
220198
renderDetails={(item) => (
221199
<div className="mt-2 flex flex-shrink-0 items-center text-sm text-gray-600 dark:text-gray-300">
@@ -227,13 +205,7 @@ export default function Home() {
227205
)}
228206
/>
229207
<ItemCardList
230-
title={
231-
<TitleWithIcon
232-
href="#recent-releases"
233-
icon={faLink}
234-
title="Recent Releases"
235-
/>
236-
}
208+
title={<TitleWithIcon href="#recent-releases" icon={faLink} title="Recent Releases" />}
237209
data={data.recentReleases}
238210
renderDetails={(item) => (
239211
<div className="mt-2 flex flex-shrink-0 text-sm text-gray-600 dark:text-gray-300">

0 commit comments

Comments
 (0)