Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/molecules/Buttons/BtnLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface props {
isDisable?: boolean
m?: string
onClick?: (e: React.MouseEvent<HTMLElement>) => void
p?: string
role?: 'button' | 'link'
tabIndex?: number
target?: '_blank' | '_self'
Expand All @@ -28,6 +29,7 @@ export function BtnLink({
isDisable = false,
m = '0',
onClick,
p,
role = 'link',
tabIndex,
target = '_blank',
Expand Down Expand Up @@ -57,6 +59,7 @@ export function BtnLink({
id={id}
onClick={isDisable ? undefined : onClick}
opacity={isDisable ? 0.5 : 1}
padding={p ?? '.25em'}
role={role}
tabIndex={tabIndex}
textDecorationLine={textDecorationLine ? 'underline' : 'none'}
Expand All @@ -79,7 +82,6 @@ export const stylesBtnLink = {
fontStyle: 'normal',
fontWeight: '500',
lineHeight: '1rem',
padding: '.25em',
textDecorationLine: 'underline',
width: 'fit-content',
_hover: {
Expand Down
18 changes: 6 additions & 12 deletions src/organisms/CourseList/components/Section.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from 'react'
import { Box, Heading, Link, List, HStack, Text, ListItem, Flex } from '@chakra-ui/react'
import { Box, Heading, List, HStack, Text, ListItem, Flex } from '@chakra-ui/react'

import { vars } from '@theme'
import { BtnLink } from '@/molecules'
import { CourseBoxContext } from '../Boxes/BoxTraditional'
import { CourseStatus } from './CourseStatus'
import { DateStatus } from './DateStatus'
import { IconSelection } from './IconSelection'
import { vars } from '@theme'
import { CourseStatus } from './CourseStatus'

export function Section(): JSX.Element | null {
const { name, dateStatus, information, progress, status } = React.useContext(CourseBoxContext)
Expand Down Expand Up @@ -64,16 +65,9 @@ export function Section(): JSX.Element | null {
<IconSelection type={item.icon} />
<Box display="inline-block" ml=".625rem">
{item.href !== undefined && item.href?.length > 0 ? (
<Link
isExternal
href={item.href}
color={vars('colors-main-deepSkyBlue')}
textDecor="underline"
fontWeight="500"
fontSize=".75rem"
>
<BtnLink href={item.href} p="0" target={item.targetBlank ? '_blank' : '_self'}>
{item.text}
</Link>
</BtnLink>
) : (
<Text m="0" color={vars('colors-neutral-gray')} fontSize=".75rem">
{item.text}
Expand Down
Loading