Skip to content

Commit

Permalink
💄 Customise colors and other updates
Browse files Browse the repository at this point in the history
  • Loading branch information
homostellaris committed Jan 18, 2025
1 parent 1e80c96 commit 39606c9
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 439 deletions.
13 changes: 11 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@ import '@ionic/react/css/text-transformation.css'
import '@ionic/react/css/flex-utils.css'
import '@ionic/react/css/display.css'

import '../styles/capacitor-starter/global.css'
import '../styles/capacitor-starter/variables.css'
/**
* Ionic Dark Palette
* -----------------------------------------------------
* For more information, please see:
* https://ionicframework.com/docs/theming/dark-mode
*/
import '@ionic/react/css/palettes/dark.always.css'

/* Theme variables */
import '../styles/theme.css'
import '../styles/globals.css'

export const metadata: Metadata = {
title: 'Starfocus',
Expand Down
28 changes: 18 additions & 10 deletions components/common/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useObservable } from 'dexie-react-hooks'
import { db } from '../db'
import {
IonButton,
IonButtons,
Expand All @@ -14,13 +12,15 @@ import {
IonTitle,
IonToolbar,
} from '@ionic/react'
import { useObservable } from 'dexie-react-hooks'
import {
cloudDoneSharp,
cloudDownloadSharp,
cloudOfflineSharp,
cloudUploadSharp,
thunderstormSharp,
} from 'ionicons/icons'
import { db } from '../db'

export const Header = ({ title }: { title: string }) => {
const user = useObservable(db.cloud.currentUser)
Expand Down Expand Up @@ -61,6 +61,22 @@ export const Header = ({ title }: { title: string }) => {
triggerAction="click"
>
<IonContent className="text-xs">
<IonHeader>
<IonToolbar>
<IonTitle>{syncState?.status}</IonTitle>
<IonButtons slot="end">
<IonButton
color="danger"
fill="solid"
onClick={() => {
db.cloud.logout()
}}
>
Unsync
</IonButton>
</IonButtons>
</IonToolbar>
</IonHeader>
{syncState?.error ? (
<p>Sync error: ${syncState.error.message}</p>
) : (
Expand Down Expand Up @@ -114,14 +130,6 @@ export const Header = ({ title }: { title: string }) => {
</IonContent>
</IonPopover>
</IonButton>
<IonButton
fill="solid"
onClick={() => {
db.cloud.logout()
}}
>
Unsync
</IonButton>
</>
) : (
<>
Expand Down
14 changes: 14 additions & 0 deletions components/common/StarRoleIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { IonIcon } from '@ionic/react'
import { StarRole } from '../db'
import { getIonIcon } from '../starRoles/icons'
import { rocketSharp } from 'ionicons/icons'

export const StarRoleIcon = ({ starRole }: { starRole?: StarRole }) => {
return (
<IonIcon
color={starRole ? 'dark' : 'light'}
icon={starRole ? getIonIcon(starRole.icon.name) : rocketSharp}
slot="end"
/>
)
}
5 changes: 4 additions & 1 deletion components/pages/Constellation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export default function Constellation() {
vertical="bottom"
horizontal="end"
>
<IonFabButton onClick={openCreateStarRoleModal}>
<IonFabButton
color="success"
onClick={openCreateStarRoleModal}
>
<IonIcon icon={add}></IonIcon>
</IonFabButton>
</IonFab>
Expand Down
20 changes: 20 additions & 0 deletions components/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ import {
calendarSharp,
chevronDownOutline,
chevronUpOutline,
cogSharp,
filterSharp,
locateOutline,
rocketSharp,
settingsSharp,
timeSharp,
} from 'ionicons/icons'
import _ from 'lodash'
Expand Down Expand Up @@ -67,6 +69,7 @@ import { useCreateTodoModal } from '../todos/create/useCreateTodoModal'
import { groupTodosByCompletedAt } from '../todos/groupTodosByCompletedAt'
import { useSnoozeTodoModal } from '../todos/snooze/useSnoozeTodoModal'
import useView, { ViewProvider } from '../view'
import { StarRoleIcon } from '../common/StarRoleIcon'

const Home = () => {
const searchbarRef = useRef<HTMLIonSearchbarElement>(null)
Expand Down Expand Up @@ -111,6 +114,19 @@ const Home = () => {
</IonButton>
</IonButtons>
<Searchbar ref={searchbarRef} />
<IonButtons slot="end">
<IonButton
id="view-menu-button"
onClick={() => {
menuController.toggle('start')
}}
>
<IonIcon
icon={settingsSharp}
slot="icon-only"
/>
</IonButton>
</IonButtons>
</IonToolbar>
</IonFooter>
</IonPage>
Expand Down Expand Up @@ -283,6 +299,7 @@ export const TodoLists = ({}: {}) => {
>
<IonFab className="fixed min-[992px]:left-[calc(100vw/12*2-40px-18px)] bottom-16">
<IonFabButton
color="success"
onClick={openCreateTodoModal}
size="small"
>
Expand Down Expand Up @@ -789,6 +806,7 @@ export const ViewMenu = ({
</IonHeader>
<IonContent className="space-y-4 ion-padding">
<IonButton
color="warning"
expand="block"
onClick={() => {
if (searchbarRef.current) {
Expand Down Expand Up @@ -869,6 +887,7 @@ export const ViewMenu = ({
</IonItem>
{starRoles.map(starRole => (
<IonItem key={starRole.id}>
<StarRoleIcon starRole={starRole} />
{starRole?.title}
<IonButton
fill="clear"
Expand Down Expand Up @@ -1020,6 +1039,7 @@ export const Searchbar = forwardRef<HTMLIonSearchbarElement>(
return (
<IonSearchbar
ref={ref}
className="mx-auto [--background:#121212]"
debounce={100}
/* Binding to the capture phase allows the searchbar to complete its native behaviour of clearing the input.
* Without this the input would blur but the input would still have a value and the todos would still be filtered. */
Expand Down
195 changes: 0 additions & 195 deletions styles/capacitor-starter/global.css

This file was deleted.

Loading

0 comments on commit 39606c9

Please sign in to comment.