Skip to content

Commit

Permalink
feat: improve login page
Browse files Browse the repository at this point in the history
## Explanation

Improve the login page by changing the types of the inputs so that
1Password can autocomplete the required fields.
  • Loading branch information
clentfort committed Feb 1, 2024
1 parent 8c7af04 commit 9e057cd
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 69 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
name: Build
name: Build

on:
push:
tags:
- "v*.*.*"
branches:
- "main"

jobs:
build:

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set up Node.js 20.10.0
uses: actions/setup-node@v4
with:
node-version: 20.10.0
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Prebuild
run: npm exec expo -- prebuild --platform android

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Set up Expo EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: Build
env:
EXPO_PUBLIC_PARSE_APPLICATION_ID: ${{ secrets.EXPO_PUBLIC_PARSE_APPLICATION_ID }}
EXPO_PUBLIC_PARSE_CLIENT_KEY: ${{ secrets.EXPO_PUBLIC_PARSE_CLIENT_KEY }}
EXPO_PUBLIC_PARSE_SERVER_URL: ${{ secrets.EXPO_PUBLIC_PARSE_SERVER_URL }}
run: npm run build:preview

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: './*.apk'

- uses: actions/checkout@v4

- name: Set up Node.js 20.10.0
uses: actions/setup-node@v4
with:
node-version: 20.10.0
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Prebuild
run: npm exec expo -- prebuild --platform android

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "gradle"

- name: Set up Expo EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: Build
env:
EXPO_PUBLIC_PARSE_APPLICATION_ID: ${{ secrets.EXPO_PUBLIC_PARSE_APPLICATION_ID }}
EXPO_PUBLIC_PARSE_CLIENT_KEY: ${{ secrets.EXPO_PUBLIC_PARSE_CLIENT_KEY }}
EXPO_PUBLIC_PARSE_SERVER_URL: ${{ secrets.EXPO_PUBLIC_PARSE_SERVER_URL }}
run: npm run build:preview

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "./*.apk"
7 changes: 5 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Betterfly App",
"slug": "betterfly-app",
"scheme": "betterfly",
"version": "1.0.0",
"version": "1.1.2",
"orientation": "portrait",
"icon": "./assets/logo.png",
"userInterfaceStyle": "light",
Expand All @@ -25,7 +25,10 @@
"backgroundColor": "#222b45"
},
"package": "com.clentfort.betterflyapp",
"permissions": ["android.permission.SCHEDULE_EXACT_ALARM"]
"permissions": [
"android.permission.SCHEDULE_EXACT_ALARM",
"android.permission.USE_EXACT_ALARM"
]
},
"web": {
"favicon": "./assets/logo.png"
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "betterfly-app",
"version": "1.0.0",
"version": "1.1.2",
"main": "expo-router/entry",
"license": "MIT",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"@tanstack/react-query": "^5.17.15",
"@ui-kitten/components": "^5.3.1",
"@ui-kitten/eva-icons": "^5.3.1",
"expo": "~50.0.4",
"expo": "~50.0.5",
"expo-constants": "~15.4.5",
"expo-device": "~5.9.3",
"expo-keep-awake": "~12.8.2",
Expand Down
6 changes: 3 additions & 3 deletions src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Platform } from "react-native";
import { SafeAreaProvider } from "react-native-safe-area-context";

import { ParseClientProvider } from "@/api/parse-client-context";
import { DataProvider } from "@/contexts/session-context";
import { SessionProvider } from "@/contexts/session-context";
import Client from "@/parse-client";

export const parseClient = new Client(
Expand Down Expand Up @@ -101,9 +101,9 @@ export default () => {
<ApplicationProvider {...eva} theme={eva.dark}>
<QueryClientProvider client={queryClient}>
<ParseClientProvider client={parseClient}>
<DataProvider>
<SessionProvider>
<Slot />
</DataProvider>
</SessionProvider>
</ParseClientProvider>
</QueryClientProvider>
</ApplicationProvider>
Expand Down
17 changes: 12 additions & 5 deletions src/app/login.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Input, Text } from "@ui-kitten/components";
import { router } from "expo-router";
import React from "react";

import PageLayout from "@/components/page-layout";
import PasswordInput from "@/components/password-input";
Expand All @@ -25,16 +24,24 @@ export default function HomeScreen(): React.ReactElement {
}}
>
<Text category="h1">Betterfly Member App</Text>
<Input label="Studio ID" value={studioId} onChangeText={setStudioId} />
<Input
keyboardType="numeric"
label="Studio ID"
defaultValue={studioId}
onChangeText={setStudioId}
/>
<Input
autoComplete="email"
label="E-Mail"
value={username}
keyboardType="email-address"
textContentType="emailAddress"
defaultValue={username}
onChangeText={setUsername}
textContentType="username"
/>
<PasswordInput
autoComplete="password"
label="Password"
value={password}
defaultValue={password}
onChangeText={setPassword}
/>
<Button
Expand Down
4 changes: 2 additions & 2 deletions src/contexts/session-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface LoginParams {
}

const SessionContext = createContext({
async login(_: LoginParams): Promise<void> {},
async login(credentials: LoginParams): Promise<void> {},
logout(): void {},
isLoggedIn: false,
});
Expand All @@ -24,7 +24,7 @@ function getServerUrl(studioId: string) {
);
}

export function DataProvider({ children }) {
export function SessionProvider({ children }) {
const [sessionToken, setSessionToken] = useStorageState<string | null>(
"session-token",
null,
Expand Down

0 comments on commit 9e057cd

Please sign in to comment.