Skip to content

Commit

Permalink
frontend fixes
Browse files Browse the repository at this point in the history
- lighter table rows by default
- coloured hover row dark mode
- fix switch description colouring
- show proper title for / page
- don't show results links section when creating event
  • Loading branch information
brownben committed Apr 3, 2024
1 parent f9849d3 commit 6d57574
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 47 deletions.
2 changes: 1 addition & 1 deletion frontend/components/Input/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const inputValidationProps = computed(() => {
:id="label"
:value="modelValue"
:type="type"
class="w-full rounded border bg-transparent p-2 text-sm text-gray-900 ring-offset-2 transition focus:outline-none focus-visible:ring-2 dark:text-gray-100 dark:ring-offset-gray-800"
class="w-full rounded border bg-white p-2 text-sm text-gray-900 ring-offset-2 transition focus:outline-none focus-visible:ring-2 dark:bg-transparent dark:text-gray-100 dark:ring-offset-gray-800"
:class="{
'border-gray-400 ring-main-600 focus:border-main-600':
state != 'invalid',
Expand Down
5 changes: 4 additions & 1 deletion frontend/components/Input/Switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const handleEvent = (value: boolean) =>
>
{{ props.label }}
</SwitchLabel>
<SwitchDescription v-if="props.description" class="text-sm text-gray-400">
<SwitchDescription
v-if="props.description"
class="text-sm text-gray-500 dark:text-gray-400"
>
{{ props.description }}
</SwitchDescription>
</div>
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/Table/RowExpanding.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<Disclosure v-slot="{ open }" as="tbody" class="group">
<tr
class="border-collapse text-gray-800 transition duration-300 ease-in-out group-focus-within:bg-main-200 group-hover:bg-main-200 dark:text-gray-100 dark:group-focus-within:bg-gray-700 dark:group-hover:bg-gray-700"
:class="{ 'bg-main-100 dark:bg-gray-800': striped }"
class="border-collapse text-gray-800 transition duration-300 ease-in-out group-focus-within:bg-main-200 group-hover:bg-main-200 dark:text-gray-100 dark:group-focus-within:bg-main-900 dark:group-hover:bg-main-900"
:class="{ 'bg-main-50 dark:bg-gray-800': striped }"
>
<slot />
<td class="relative table-cell text-center md:hidden">
Expand All @@ -27,8 +27,8 @@

<DisclosurePanel
as="tr"
class="border-collapse text-right transition duration-300 group-focus-within:bg-main-200 group-hover:bg-main-200 md:hidden dark:group-focus-within:bg-gray-700 dark:group-hover:bg-gray-700"
:class="{ 'bg-main-100 dark:bg-gray-800': striped }"
class="border-collapse text-right transition duration-300 group-focus-within:bg-main-200 group-hover:bg-main-200 md:hidden dark:group-focus-within:bg-main-900 dark:group-hover:bg-main-900"
:class="{ 'bg-main-50 dark:bg-gray-800': striped }"
>
<td class="pb-2" :colspan="100">
<slot name="expansion" />
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Table/RowResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defineProps({
</script>
<template>
<tr
class="text-gray-800 transition-colors odd:bg-main-100 hover:bg-main-200 dark:text-gray-100 dark:odd:bg-gray-800 dark:hover:bg-gray-700"
class="text-gray-800 transition-colors odd:bg-main-50 hover:bg-main-100 dark:text-gray-100 dark:odd:bg-gray-800 dark:hover:bg-main-900"
>
<td class="py-3 text-center">
<template v-if="['max', 'average', 'manual'].includes(result.type)">
Expand Down
40 changes: 1 addition & 39 deletions frontend/pages/events/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ const form = reactive({
website: '',
more_information: '',
league: queryToString(route.query.league ?? ''),
results_links: {
'Standard Results': '',
Routegadget: '',
Winsplits: '',
'GPS Tracking': '',
},
results_links: {},
allow_user_submitted_results: false,
compulsory: false,
league_group: '',
Expand Down Expand Up @@ -105,39 +100,6 @@ useTitle({
class="col-span-2"
/>

<FormHeading
title="Results Links"
description="Add links to other results display and analysis sites."
/>
<Input
v-model="form.results_links['Standard Results']"
label="Standard HTML Results:"
type="url"
class="col-span-2"
:validator="IsValidURL"
/>
<Input
v-model="form.results_links['Routegadget']"
label="Routegadget:"
type="url"
class="col-span-2"
:validator="IsValidURL"
/>
<Input
v-model="form.results_links['Winsplits']"
label="Winsplits:"
type="url"
class="col-span-2"
:validator="IsValidURL"
/>
<Input
v-model="form.results_links['GPS Tracking']"
label="GPS Tracking:"
type="url"
class="col-span-2"
:validator="IsValidURL"
/>

<FormHeading
title="Scoring"
description="Adjust how the event is scored in the league"
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const user = useUser()
const loggedIn = useLoggedIn()
const { data } = await useData<Home>(`misc/home`)
useTitle({
useSeoMeta({
title: 'Munro',
description:
'League Results. Sorted with Munro. Sports League Results Calculated Quick and Easily, with Results Sorting and Filtering Options',
Expand Down

0 comments on commit 6d57574

Please sign in to comment.