Skip to content

Commit

Permalink
fix: refactor course link as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
22Xy committed Jan 14, 2024
1 parent 44bf24c commit 7ed803d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "cross-env REACT_APP_API_URL='http://features-testing-env.eba-mau9qkgr.us-east-1.elasticbeanstalk.com/' docusaurus start",
"build": "cross-env REACT_APP_API_URL='http://features-testing-env.eba-mau9qkgr.us-east-1.elasticbeanstalk.com/' docusaurus build",
"build": "docusaurus build",
"build:preview": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
Expand Down
10 changes: 9 additions & 1 deletion src/components/CoursesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ type TProps = {
const CourseCard = (props: TProps) => {
const { course } = props;

const courseRoutePath = (path: string) => {
if (path.startsWith("http")) {
return path;
} else {
return `/${path}`;
}
};

return (
<Link
to={`/${course.route_path}`}
to={courseRoutePath(course.route_path)}
className="hover:no-underline hover:text-gray-900"
>
<div className="w-full overflow-hidden border border-solid md:w-[300px] rounded-md shadow-sm transition-shadow hover:shadow-lg">
Expand Down

0 comments on commit 7ed803d

Please sign in to comment.