Skip to content
Open
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
60 changes: 60 additions & 0 deletions .github/workflows/ci-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI checks for web workspace

on:
push:
branches: ['main']
paths: ['web/**/*', '!**/*.{txt,md}']
pull_request:
branches: ['main']
paths: ['web/**/*', '!**/*.{txt,md}']

defaults:
run:
working-directory: 'web'

jobs:
Prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*' # TODO: determine version used in production server
cache: yarn
cache-dependency-path: 'yarn.lock'
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Run prettier
run: yarn prettier . --check --ignore-unknown
ESLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: yarn
cache-dependency-path: 'yarn.lock'
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Run ESLint
run: yarn eslint .
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: yarn
cache-dependency-path: 'yarn.lock'
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Compile with tsc
run: yarn tsc --noEmit --strict
5 changes: 2 additions & 3 deletions web/components/answers/compatibility-questions-display.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function CompatibilityAnswerBlock(props: {
<Row className="bg-canvas-50 w-fit gap-1 rounded px-2 py-1 text-sm">
{answerText}
</Row>
<Row className="px-2 -mt-4">
<Row className="-mt-4 px-2">
{answer.explanation && (
<Linkify className="" text={answer.explanation} />
)}
Expand All @@ -419,7 +419,7 @@ function CompatibilityAnswerBlock(props: {
? 'Acceptable'
: 'Also acceptable'}
</div>
<Row className="flex-wrap gap-2 -mt-2">
<Row className="-mt-2 flex-wrap gap-2">
{distinctPreferredAnswersText.map((text) => (
<Row
key={text}
Expand All @@ -432,7 +432,6 @@ function CompatibilityAnswerBlock(props: {
</Col>
)}
<Col>

{comparedLover && (
<Row className="w-full justify-end sm:hidden">
<CompatibilityDisplay
Expand Down
2 changes: 1 addition & 1 deletion web/components/answers/free-response-add-question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function AddQuestionButton(props: {
user: User
refreshAnswers: () => void
}) {
const { isFirstQuestion, questions, user, refreshAnswers } = props
const { /*isFirstQuestion,*/ questions, user, refreshAnswers } = props
const [openModal, setOpenModal] = usePersistentInMemoryState(
false,
`add-question-${user.id}`
Expand Down
14 changes: 7 additions & 7 deletions web/components/browse-matches-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export const BrowseMatchesButton = (props: {
placeholder: 'Write your introduction...',
})

const [isSubmitting, setIsSubmitting] = useState(false)
const [isSubmitting /*, setIsSubmitting*/] = useState(false)

const submit = async () => {
const introduction =
(editor?.getCharacterCount() ?? 0) > 0 ? editor?.getJSON() : undefined
//const introduction =
;(editor?.getCharacterCount() ?? 0) > 0 ? editor?.getJSON() : undefined

// setIsSubmitting(true)
// const result = await createMatch({
Expand Down Expand Up @@ -107,14 +107,14 @@ const BrowseMatchesDialog = (props: {
lover,
potentialLovers,
compatibilityScores,
isSubmitting,
//isSubmitting,
setOpen,
submit,
editor,
//submit,
//editor,
} = props

const [query, setQuery] = useState('')
const [error, setError] = useState<string | undefined>(undefined)
//const [error, setError] = useState<string | undefined>(undefined)

const currentUser = useUser()
const isCurrentUser = currentUser?.id === lover.user_id
Expand Down
2 changes: 1 addition & 1 deletion web/components/filters/location-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function LocationFilterText(props: {
radius: number
highlightedClass?: string
}) {
const { location, youLover, radius, highlightedClass } = props
const { location, /*youLover,*/ radius, highlightedClass } = props

if (!location) {
return (
Expand Down
5 changes: 3 additions & 2 deletions web/components/layout/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ export function ControlledTabs(props: TabProps & { activeIndex: number }) {
aria-current={activeIndex === i ? 'page' : undefined}
>
<Col
className={clsx()
// tab.stackedTabIcon && (activeIndex !== i) && 'opacity-85'
className={
clsx()
// tab.stackedTabIcon && (activeIndex !== i) && 'opacity-85'
}
>
<Tooltip text={tab.tooltip}>
Expand Down
4 changes: 2 additions & 2 deletions web/components/love-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function LovePage(props: {
const bottomNavOptions = user
? getBottomNavigation(user, lover)
: signedOutNavigation()
const [isModalOpen, setIsModalOpen] = useState(false)
//const [isModalOpen, setIsModalOpen] = useState(false)
const desktopSidebarOptions = getDesktopNav(user)

const mobileSidebarOptions = user
Expand All @@ -55,7 +55,7 @@ export function LovePage(props: {
// eslint-disable-next-line react-hooks/rules-of-hooks
trackPageView && useTracking(`view love ${trackPageView}`, trackPageProps)
useOnline()
const [isAddFundsModalOpen, setIsAddFundsModalOpen] = useState(false)
const [, /*isAddFundsModalOpen*/ setIsAddFundsModalOpen] = useState(false)

return (
<>
Expand Down
5 changes: 4 additions & 1 deletion web/components/required-lover-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export const RequiredLoveUserForm = (props: {
setEditUsername?: (name: string) => unknown
setEditDisplayName?: (name: string) => unknown
lover: LoverRow
setLover: <K extends Column<'lovers'>>(key: K, value: LoverRow[K] | undefined) => void
setLover: <K extends Column<'lovers'>>(
key: K,
value: LoverRow[K] | undefined
) => void
isSubmitting: boolean
onSubmit?: () => void
loverCreatedAlready?: boolean
Expand Down
5 changes: 3 additions & 2 deletions web/components/widgets/choices-toggle-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ const colorClasses = {

export type ColorType = keyof typeof colorClasses

export function ChoicesToggleGroup<T extends Record<string, string | number | boolean>>(
props: {
export function ChoicesToggleGroup<
T extends Record<string, string | number | boolean>
>(props: {
currentChoice: T[keyof T] | undefined
choicesMap: T
disabled?: boolean
Expand Down
2 changes: 1 addition & 1 deletion web/components/widgets/searchable-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function SearchableSelect(props: {

return (
<Popover className={clsx('relative', parentClassName)}>
{({ open, close }) => (
{({ close, ..._ }) => (
<>
<Popover.Button
ref={setReferenceElement}
Expand Down
4 changes: 2 additions & 2 deletions web/components/widgets/user-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ export function UserLink(props: {
)
}

function BotBadge() {
/*function BotBadge() {
return (
<span className="bg-ink-100 text-ink-800 ml-1.5 whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-medium">
Bot
</span>
)
}
}*/

export function BannedBadge() {
return (
Expand Down
5 changes: 4 additions & 1 deletion web/pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ function ProfilePageInner(props: { user: User; lover: Lover }) {
user,
})

const setLoverState = <K extends Column<'lovers'>> (key: K, value: LoverRow[K] | undefined) => {
const setLoverState = <K extends Column<'lovers'>>(
key: K,
value: LoverRow[K] | undefined
) => {
setLover((prevState) => ({ ...prevState, [key]: value }))
}

Expand Down