Skip to content

Commit f267187

Browse files
authored
Merge pull request #79 from React-ChatBotify/view-theme
view theme with safe url
2 parents 87227b1 + 3417e50 commit f267187

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/components/profile/Themecard.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
import { Link } from "react-router-dom"
12
import { GenericItemCardProps } from "../../interfaces/profile"
23

3-
export const ThemeCard: React.FC<GenericItemCardProps> = ({ themeImg, name, description }) => {
4+
export const ThemeCard: React.FC<GenericItemCardProps> = ({ themeImg, id, name, description }) => {
45
return (
56
<div className="flex gap-3 w-full h-fit flex-row">
67
<img className="w-20 rounded-lg" src={themeImg} />
78
<div className="flex flex-col w-full relative gap-3">
89
<h1 className="font-extrabold text-xl">{name}</h1>
910
<p className="text-primary-mutedForeground text-sm block ">{description}</p>
10-
{/* <div className="flex absolute bottom-0 bg-primary-darkForeground flex-row gap-2">
11-
<a className=" cursor-pointer text-sm text-blue-500 ">View Theme</a>
12-
{mode == 1 && <a className="cursor-pointer text-sm text-red-500">Remove favourite</a>}
13-
</div> */}
11+
<div className="flex absolute bottom-0 bg-primary-darkForeground flex-row gap-2">
12+
<Link className=" cursor-pointer font-extrabold text-sm text-blue-500"
13+
to={"/themes?theme="+encodeURIComponent(id )} >View Theme</Link>
14+
{/* {mode == 1 && <a className="cursor-pointer text-sm text-red-500">Remove favourite</a>} */}
15+
</div>
1416
</div>
1517
</div>
1618
)

src/interfaces/profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface PropTypes { type: string, items: Array<any>, loading: boolean, error: any };
2-
export interface GenericItemCardProps {mode: number, name: string, id?: number, themeImg: string, description: string};
2+
export interface GenericItemCardProps {mode: number, name: string, id: string, themeImg: string, description: string};
33
export type ItemsIterator = {items: Array<GenericItemCardProps>, mode: number, type: string, config: any};
44

55
interface EmptyState {

0 commit comments

Comments
 (0)