Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewBemis committed Nov 6, 2024
1 parent 1efd0db commit e8d25c6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const MailingListWidget = ({ portal }: { portal: Portal }) => {
}, [portal.shortcode])

return (
<InfoCard classNames={''}>
<InfoCard>
<InfoCardHeader>
<div className="d-flex align-items-center justify-content-between w-100">
<span className="fw-bold">Mailing List</span>
Expand Down
2 changes: 1 addition & 1 deletion ui-admin/src/portal/dashboard/widgets/StudyTeamWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const StudyTeamWidget = ({ portal }: { portal: Portal }) => {
})

return (
<InfoCard classNames={''}>
<InfoCard>
<InfoCardHeader>
<div className="d-flex align-items-center justify-content-between w-100">
<span className="fw-bold">Team Members</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const StudyTrendsWidget = ({ portal, study }: { portal: Portal, study: St
}

return (
<InfoCard classNames={''}>
<InfoCard>
<InfoCardHeader>
<div className="d-flex align-items-center justify-content-between w-100">
<span className="fw-bold text-wrap text-break">{study.name}</span>
Expand Down
2 changes: 1 addition & 1 deletion ui-admin/src/portal/dashboard/widgets/StudyWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const StudyWidget = ({ portal }: { portal: Portal }) => {
})

return (
<InfoCard classNames={''}>
<InfoCard>
<InfoCardHeader>
<div className="d-flex align-items-center justify-content-between w-100">
<span className="fw-bold">Studies</span>
Expand Down
2 changes: 1 addition & 1 deletion ui-admin/src/portal/dashboard/widgets/TutorialsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { InfoCard, InfoCardBody, InfoCardHeader } from 'components/InfoCard'

export const TutorialsWidget = () => {
return (
<InfoCard classNames={''}>
<InfoCard>
<InfoCardHeader>
<div className="d-flex align-items-center justify-content-between w-100">
<span className="fw-bold">Help & Tutorials</span>
Expand Down
30 changes: 19 additions & 11 deletions ui-admin/src/portal/dashboard/widgets/WebsiteWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button } from 'components/forms/Button'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faEye, faGear, faImage, faPalette, faPencil } from '@fortawesome/free-solid-svg-icons'
import { faArrowUpRightFromSquare, faEye, faGear, faImage, faPalette, faPencil } from '@fortawesome/free-solid-svg-icons'

Check failure on line 3 in ui-admin/src/portal/dashboard/widgets/WebsiteWidget.tsx

View workflow job for this annotation

GitHub Actions / build

This line has a length of 121. Maximum allowed is 120
import React from 'react'
import { Portal } from '@juniper/ui-core'
import { DropdownButton } from 'study/participants/survey/SurveyResponseView'
Expand All @@ -13,7 +13,7 @@ export const WebsiteWidget = ({ portal }: { portal: Portal }) => {
env.environmentName === 'live')?.portalEnvironmentConfig.participantHostname

return (
<InfoCard classNames={''}>
<InfoCard>
<InfoCardHeader>
<div className="d-flex align-items-center justify-content-between w-100">
<span className="fw-bold">Website</span>
Expand All @@ -31,15 +31,23 @@ export const WebsiteWidget = ({ portal }: { portal: Portal }) => {
</div>
</InfoCardHeader>
<InfoCardBody>
<div className="d-flex">
<div style={{ minHeight: '200px' }}>
{ livePortalUrl ?
<img className="border rounded-3"
style={{ maxWidth: '100%', height: 'auto' }}
src={`https://api.urlbox.io/v1/A8hJem0DKIAE8mDm/png?url=${livePortalUrl}`}
alt={'Website preview'}/> :
<span className="text-muted bg-gray">Website not yet published</span>
}
<div className="container">
<div className="w-100">
<div style={{ minHeight: '200px' }} className="d-flex justify-content-center align-items-center">
{livePortalUrl ?
<Button
variant="light"
className="border"
onClick={() => {
const url = livePortalUrl?.startsWith('http') ? livePortalUrl : `https://${livePortalUrl}`
window.open(url, '_blank')
}}
>
<FontAwesomeIcon icon={faArrowUpRightFromSquare}/> Visit website
</Button> :
<span className="text-muted bg-gray">Website not yet published</span>
}
</div>
</div>
</div>
</InfoCardBody>
Expand Down

0 comments on commit e8d25c6

Please sign in to comment.