Skip to content

Commit

Permalink
fix eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
FeimeiChen committed Mar 29, 2024
1 parent 6505687 commit c986998
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 76 deletions.
4 changes: 2 additions & 2 deletions ui/src/components/AboutInfoItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import Image from "next/image";
import React from 'react';
import Image from 'next/image';

const AboutInfoItem = ({src, alt, description, pSize}: {
src: string,
Expand Down
36 changes: 23 additions & 13 deletions ui/src/components/UHGroupingsInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import React from 'react';
import AboutInfoItem from '@/components/AboutInfoItem';

const UHGroupingsInfo = ({h1Color, h1Weight, AboutInfoItemSize}: { h1Color: string, h1Weight: string, AboutInfoItemSize?: string }) => {

const UHGroupingsInfo = (
{
h1Color,
h1Weight,
AboutInfoItemSize
}: {
h1Color: string,
h1Weight: string,
AboutInfoItemSize?: string
}) => {
const textSize = AboutInfoItemSize ? AboutInfoItemSize : 'text-base';
return (
<div>
Expand All @@ -16,22 +26,22 @@ const UHGroupingsInfo = ({h1Color, h1Weight, AboutInfoItemSize}: { h1Color: stri
<div className="grid grid-cols-1 md:grid-cols-3 gap-7 pt-3">
<AboutInfoItem
pSize={textSize}
src={"/uhgroupings/cogs.svg"}
alt={"Cogs icon"}
description={"Create groupings, manage grouping memberships, control members' " +
"self-service options, designate sync destinations, and more."}/>
src={'/uhgroupings/cogs.svg'}
alt={'Cogs icon'}
description={'Create groupings, manage grouping memberships, control members\' ' +
'self-service options, designate sync destinations, and more.'}/>
<AboutInfoItem
pSize={textSize}
src={"/uhgroupings/id-email.svg"}
alt={"Email icon"}
description={"Synchronize groupings email LISTSERV lists," +
" attributes for access control via CAS and LDAP, etc.."}/>
src={'/uhgroupings/id-email.svg'}
alt={'Email icon'}
description={'Synchronize groupings email LISTSERV lists,' +
' attributes for access control via CAS and LDAP, etc..'}/>
<AboutInfoItem
pSize={textSize}
src={"/uhgroupings/watch.svg"}
alt={"Watch icon"}
description={"Leverage group data from official sources," +
" which can substantially reduce the manual overhead of membership management."}/>
src={'/uhgroupings/watch.svg'}
alt={'Watch icon'}
description={'Leverage group data from official sources,' +
' which can substantially reduce the manual overhead of membership management.'}/>
</div>
</div>
</div>
Expand Down
39 changes: 22 additions & 17 deletions ui/src/components/home/AfterLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ const AfterLogin = (
<div className="container bg-seafoam pt-7 pb-7">
<div className="grid sm:grid-cols-12 text-center justify-center items-center gap-4">
<div className="sm:col-span-3 md:col-span-2">
<div className="flex justify-center items-center rounded-full h-[100px] w-[100px] bg-white mx-auto relative lg:ml-0">
<div className="flex justify-center items-center rounded-full
h-[100px] w-[100px] bg-white mx-auto relative lg:ml-0">
<Image
src="/uhgroupings/user-solid.svg"
alt="user-solid"
width={56}
height={64}
/>
<div
className="bg-blue-background rounded-full flex justify-center items-center h-[30px] w-[30px] absolute left-3 bottom-0 ml-16">
className="bg-blue-background rounded-full flex justify-center
items-center h-[30px] w-[30px] absolute left-3 bottom-0 ml-16">
<KeyRound className="fill-white stroke-none p-0.5"/>
</div>
</div>
Expand All @@ -55,29 +57,32 @@ const AfterLogin = (
number={0}
show={false}
title={'Administration'}
description={"Manage the list of Administrators for this service. Search for and manage any grouping on behalf of the owner."}
link={"/admin"}
text={"Admin"}
description={'Manage the list of Administrators for this service. ' +
'Search for and manage any grouping on behalf of the owner.'}
link={'/admin'}
text={'Admin'}
/>}
<UserInfoItem
alt={"id-card"}
src={"uhgroupings/id-card-solid.svg"}
alt={'id-card'}
src={'uhgroupings/id-card-solid.svg'}
number={numberOfMemberships}
show={true}
title={"Memberships"}
description={"View and manage my memberships. Search for new groupings to join as a member."}
link={"/memberships"}
text={"Memberships"}
title={'Memberships'}
description={'View and manage my memberships. ' +
'Search for new groupings to join as a member.'}
link={'/memberships'}
text={'Memberships'}
/>
{isOwner && <UserInfoItem
alt={"wrench-solid"}
src={"uhgroupings/wrench-solid.svg"}
alt={'wrench-solid'}
src={'uhgroupings/wrench-solid.svg'}
number={numberOfGroupings}
show={true}
title={"Groupings"}
description={"Review members, manage Include and Exclude lists, configure preferences, and export members."}
link={"/groupings"}
text={"Groupings"}
title={'Groupings'}
description={'Review members, manage Include and Exclude lists, ' +
'configure preferences, and export members.'}
link={'/groupings'}
text={'Groupings'}
/>}
</div>
</main>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/home/Announcement.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';
import React, {useState} from "react";
import {Alert, AlertDescription} from "@/components/ui/alert";
import React, {useState} from 'react';
import {Alert, AlertDescription} from '@/components/ui/alert';

const Announcement = ({announcement}: { announcement: String }
const Announcement = ({announcement}: { announcement: string }
) => {
const [open, setOpen] = useState(true);

Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/home/UserInfoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const UserInfoItem = (
src={src}
width={alt === 'id-card' ? 54 : 48}
height={48}
style={{maxWidth: alt === 'id-card' ? 54 : 48, height: "auto"}}
style={{maxWidth: alt === 'id-card' ? 54 : 48, height: 'auto'}}
className="mr-5 mb-4"
/>
{show && <span className="text-2.5 text-text-primary">{number}</span>}
Expand Down
82 changes: 42 additions & 40 deletions ui/src/components/ui/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,61 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from 'react'
import { cva, type VariantProps } from 'class-variance-authority'

import { cn } from "@/components/ui/utils"
import { cn } from '@/components/ui/utils'

const alertVariants = cva(
"relative w-full rounded-lg border border-slate-200 p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-slate-950 dark:border-slate-800 dark:[&>svg]:text-slate-50",
{
variants: {
variant: {
default: "bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50",
destructive:
"border-red-500/50 text-red-500 dark:border-red-500 [&>svg]:text-red-500 dark:border-red-900/50 dark:text-red-900 dark:dark:border-red-900 dark:[&>svg]:text-red-900",
},
},
defaultVariants: {
variant: "default",
},
}
// eslint-disable-next-line @stylistic/max-len
'relative w-full rounded-lg border border-slate-200 p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-slate-950 dark:border-slate-800 dark:[&>svg]:text-slate-50',
{
variants: {
variant: {
default: 'bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50',
destructive:
// eslint-disable-next-line @stylistic/max-len
'border-red-500/50 text-red-500 dark:border-red-500 [&>svg]:text-red-500 dark:border-red-900/50 dark:text-red-900 dark:dark:border-red-900 dark:[&>svg]:text-red-900',
},
},
defaultVariants: {
variant: 'default',
},
}
)

const Alert = React.forwardRef<
HTMLDivElement,
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
>(({ className, variant, ...props }, ref) => (
<div
ref={ref}
role="alert"
className={cn(alertVariants({ variant }), className)}
{...props}
/>
<div
ref={ref}
role="alert"
className={cn(alertVariants({ variant }), className)}
{...props}
/>
))
Alert.displayName = "Alert"
Alert.displayName = 'Alert'

const AlertTitle = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
>(({ className, ...props }, ref) => (
<h5
ref={ref}
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
{...props}
/>
<h5
ref={ref}
className={cn('mb-1 font-medium leading-none tracking-tight', className)}
{...props}
/>
))
AlertTitle.displayName = "AlertTitle"
AlertTitle.displayName = 'AlertTitle'

const AlertDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("text-sm [&_p]:leading-relaxed", className)}
{...props}
/>
<div
ref={ref}
className={cn('text-sm [&_p]:leading-relaxed', className)}
{...props}
/>
))
AlertDescription.displayName = "AlertDescription"
AlertDescription.displayName = 'AlertDescription'

export { Alert, AlertTitle, AlertDescription }

0 comments on commit c986998

Please sign in to comment.