Skip to content

Commit

Permalink
feat: update nativewind and add theme toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
younes200 committed May 16, 2024
1 parent 7f8eaeb commit d9ff429
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/actions/setup-bun-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 🔗 Links:
# Source file: https://github.com/launchtrack/expo-starters/blob/master/.github/actions/setup-bun-install/action.yml
# Composite actions docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action

# ✍️ Description:
# This is a composite action, which means it can be used in other actions.
# It is used in almost all workflows to set up the environment and install dependencies.
# Updating the package manager or Node version here will be reflected in all workflows.

# 👀 Example usage:
# - name : 📦 Setup bun + install deps
# uses: ./.github/actions/setup-bun

name: 'Setup Node + PNPM + Install Dependencies'
description: 'Setup Node + PNPM + Install Dependencies'
runs:
using: 'composite'
steps:
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: 📦 Install Project Dependencies
run: bun install --frozen-lockfile
28 changes: 28 additions & 0 deletions .github/workflows/eas-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish PWA to Github Pages

on:
workflow_dispatch:

jobs:
Build:
name: Publish PWA to Github Pages
runs-on: ubuntu-latest
steps:

- name: 📦 Checkout project repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install

- name: ⚙️ Run Prebuild
run: bun export
shell: bash

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
28 changes: 28 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"css.customData": [
".vscode/css_custom_data.json"
],
"files.associations": {
"*.css": "tailwindcss"
}
}
12 changes: 7 additions & 5 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FlashList } from "@shopify/flash-list";
import { Stack, useRouter } from "expo-router";
import * as React from "react";
import { FlatList, View } from "react-native";
import { ThemeToggle } from "~/components/ThemeToggle";
import { Badge } from "~/components/ui/badge";
import { Button } from "~/components/ui/button";
import {
Expand Down Expand Up @@ -38,7 +39,7 @@ const HabitCard: React.FC<HabitProps> = ({ habit, onDelete }) => {
</View>
</CardHeader>
<CardContent>

</CardContent>
<CardFooter className="flex-col gap-3">
<Progress value={10} className="h-2" indicatorClassName="bg-sky-600" />
Expand All @@ -55,7 +56,7 @@ export default function Screen() {
const [habits, setHabits] = React.useState<Habit[]>([]);
const ref = React.useRef(null);
useScrollToTop(ref);

const router = useRouter();

React.useEffect(() => {
Expand All @@ -78,9 +79,7 @@ export default function Screen() {
options={{
title: "Habits",
headerRight: () => (
<Button onPress={() => router.push("/habits/new")}>
<Text>Add</Text>
</Button>
<ThemeToggle />
),
}}
/>
Expand All @@ -97,6 +96,9 @@ export default function Screen() {
keyExtractor={(item) => item.id}
ListFooterComponent={<View className='py-4' />}
/>
<Button onPress={() => router.push("/habits/new")}>
<Text>Add</Text>
</Button>
</View>
);
}
Binary file modified bun.lockb
Binary file not shown.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start -c --web",
"format": "biome check --no-errors-on-unmatched --apply .",
"postinstall": "npx tailwindcss -i ./global.css -o ./node_modules/.cache/nativewind/global.css"
"export": "expo export -p web",
"format": "biome check --no-errors-on-unmatched --apply ."
},
"dependencies": {
"@gorhom/bottom-sheet": "^4.6.1",
Expand All @@ -32,7 +32,7 @@
"@radix-ui/react-tooltip": "^1.0.7",
"@react-native-async-storage/async-storage": "1.21.0",
"@react-navigation/native": "^6.0.2",
"@shopify/flash-list": "^1.6.4",
"@shopify/flash-list": "^1.6.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"expo": "~50.0.17",
Expand All @@ -43,7 +43,7 @@
"expo-status-bar": "~1.11.1",
"expo-system-ui": "~2.9.4",
"lucide-react-native": "^0.314.0",
"nativewind": "^4.0.1",
"nativewind": "^4.0.36",
"phosphor-react-native": "^2.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down

0 comments on commit d9ff429

Please sign in to comment.