Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen74 committed Oct 6, 2023
1 parent 54d40e7 commit f5547c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,19 @@ const CourseLinkInfos: FC<CourseLinkInfosProps> = ({ course }) => {
const onlineLocation = course.CourseLocations.find((location) => location.locationOption === 'ONLINE');

return (
<div className="flex justify-center items-center">
<div className="flex flex-col justify-between items-center">
<div className="mb-10 ">
<Button className=" bg-blue-200" as="a" href={course.chatLink} filled inverted>
{t('course:toCourseChat')}
</Button>
</div>
{onlineLocation && onlineLocation.defaultSessionAddress && (
<div className="mx-4">
{/* <a
href={onlineLocation.defaultSessionAddress}
target="_blank"
rel="noopener noreferrer"
className="text-white inline-block max-w-[100px]"
>
{t('course-page:to-online-meeting')}
</a> */}
<Button
as="a"
href={onlineLocation.defaultSessionAddress}
filled
inverted
// className="bg-edu-course-current"
>
<div className="">
<Button className=" bg-blue-200" as="a" href={onlineLocation.defaultSessionAddress} filled inverted>
{t('course:toOnlineMeeting')}
</Button>
</div>
)}{' '}
<div className="mx-4">
<Button
as="a"
href={course.chatLink}
filled
inverted
// className="bg-edu-course-current"
>
{t('course:toCourseChat')}
</Button>
</div>
)}
</div>
);
};
Expand Down
17 changes: 6 additions & 11 deletions frontend-nx/apps/edu-hub/components/common/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
AnchorHTMLAttributes,
ButtonHTMLAttributes,
FC,
ReactNode,
} from 'react';
import { AnchorHTMLAttributes, ButtonHTMLAttributes, FC, ReactNode } from 'react';
import Link, { LinkProps } from 'next/link';

type Props =
Expand Down Expand Up @@ -37,12 +32,12 @@ export const Button: FC<Props> = (props) => {
: 'bg-edu-black text-white'
: 'text-edu-black';

const combinedClassName = `${
props.className ? `${props.className} ` : ''
}px-6 py-2 border-2 border-edu-black rounded-full items-center cursor-pointer select-none ${colors}`;
const combinedClassName = `px-6 py-2 border-2 border-edu-black rounded-full items-center cursor-pointer select-none ${colors} ${
props.className ? `${props.className}` : ''
}`;

if (props.as === 'a') {
const { as,className, filled, ...rest } = props;
const { as, className, filled, ...rest } = props;
return (
<a className={combinedClassName} {...rest}>
{props.children}
Expand All @@ -51,7 +46,7 @@ export const Button: FC<Props> = (props) => {
}

if (props.as === 'link') {
const { as,className, filled, ...rest } = props;
const { as, className, filled, ...rest } = props;
return (
<Link className={combinedClassName} {...rest}>
{props.children}
Expand Down

0 comments on commit f5547c7

Please sign in to comment.