mirror of
https://github.com/Stef-00012/Zipline-Android-App.git
synced 2025-05-11 18:35:58 +02:00
some formatting
This commit is contained in:
parent
3aeb0d2816
commit
5cf2e310da
14 changed files with 47 additions and 36 deletions
|
@ -1,5 +1,5 @@
|
|||
import { useRouter } from "expo-router";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
import { useRouter } from "expo-router";
|
||||
|
||||
import { styles } from "@/styles/not-found";
|
||||
|
||||
|
@ -19,7 +19,7 @@ export default function NotFoundScreen() {
|
|||
});
|
||||
}}
|
||||
>
|
||||
Head to the Dashboard
|
||||
<Text styles={styles.buttonText}>Head to the Dashboard</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Header from "@/components/Header";
|
||||
import { Slot, useRouter } from "expo-router";
|
||||
import Header from "@/components/Header";
|
||||
|
||||
import { ShareIntentProvider } from "expo-share-intent";
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { useRouter } from "expo-router";
|
||||
import { useShareIntentContext } from "expo-share-intent";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, View, TextInput, Pressable } from "react-native";
|
||||
import { styles } from "@/styles/home";
|
||||
import { getRecentFiles, getCurrentUser } from "@/functions/zipline/user";
|
||||
import { getUserStats } from "@/functions/zipline/stats";
|
||||
import type { APIRecentFiles, APISelfUser, APIUserStats } from "@/types/zipline";
|
||||
import { getRecentFiles, getCurrentUser } from "@/functions/zipline/user";
|
||||
import { Text, View, TextInput, Pressable } from "react-native";
|
||||
import { useShareIntentContext } from "expo-share-intent";
|
||||
import { getUserStats } from "@/functions/zipline/stats";
|
||||
import { useEffect, useState } from "react";
|
||||
import * as db from "@/functions/database";
|
||||
import { useRouter } from "expo-router";
|
||||
import { styles } from "@/styles/home";
|
||||
|
||||
export default function Home() {
|
||||
const router = useRouter();
|
||||
|
@ -24,11 +24,12 @@ export default function Home() {
|
|||
const [inputtedUrl, setInputtedUrl] = useState<string | null>(null);
|
||||
const [inputtedToken, setInputtedToken] = useState<string | null>(null);
|
||||
|
||||
const [token, setToken] = useState<string | null>(db.get("token"));
|
||||
const [url, setUrl] = useState<string | null>(db.get("url"));
|
||||
const [token, setToken] = useState<string | null>(db.get("token"));
|
||||
|
||||
const [user, setUser] = useState<APISelfUser | null>(null);
|
||||
const [recentFiles, setRecentFiles] = useState<APIRecentFiles | null>();
|
||||
const [stats, setStats] = useState<APIUserStats | null>();
|
||||
const [recentFiles, setRecentFiles] = useState<APIRecentFiles | null>();
|
||||
|
||||
const mainContainerStyles = user ? {
|
||||
...styles.mainContainer
|
||||
|
@ -40,23 +41,23 @@ export default function Home() {
|
|||
useEffect(() => {
|
||||
(async () => {
|
||||
const user = await getCurrentUser();
|
||||
const recentFiles = await getRecentFiles();
|
||||
const stats = await getUserStats();
|
||||
const recentFiles = await getRecentFiles();
|
||||
|
||||
setUser(user);
|
||||
setRecentFiles(recentFiles);
|
||||
setStats(stats);
|
||||
setRecentFiles(recentFiles);
|
||||
})();
|
||||
});
|
||||
}, []);
|
||||
|
||||
async function handleLogin() {
|
||||
const user = await getCurrentUser();
|
||||
const recentFiles = await getRecentFiles();
|
||||
const stats = await getUserStats();
|
||||
const recentFiles = await getRecentFiles();
|
||||
|
||||
setUser(user);
|
||||
setRecentFiles(recentFiles);
|
||||
setStats(stats);
|
||||
setRecentFiles(recentFiles);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APIExports } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/user/export
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APIFile, APIFiles, APISettings } from "@/types/zipline";
|
||||
import axios from "axios";
|
||||
import { getSettings } from "@/functions/zipline/settings";
|
||||
import bytesFn from "bytes";
|
||||
import { convertToBlob, generateRandomString, guessMimetype } from "../util";
|
||||
import type { APIFile, APIFiles, APISettings } from "@/types/zipline";
|
||||
import { getSettings } from "@/functions/zipline/settings";
|
||||
import type { Mimetypes } from "@/types/mimetypes";
|
||||
import * as db from "@/functions/database";
|
||||
import bytesFn from "bytes";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/user/files
|
||||
export async function getFiles(page: number): Promise<APIFiles | null> {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APIFoldersNoIncl, APIFolders, APIFolder } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/user/folders
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APIInvites } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/auth/invites
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APISettings } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/server/settings
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APIUserStats, APIStats } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/stats
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APITag, APITags } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/user/tags
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APIURLs, APIURL } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /user/urls
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as db from "@/functions/database";
|
||||
import type { APIRecentFiles, APISelfUser } from "@/types/zipline";
|
||||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/user
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import * as db from "@/functions/database";
|
||||
import axios from "axios";
|
||||
import type {
|
||||
APIUsersNoIncl,
|
||||
APIUsers,
|
||||
APIUser,
|
||||
APIUserQuota,
|
||||
} from "@/types/zipline";
|
||||
import axios from "axios";
|
||||
|
||||
// GET /api/users(?noincl=true)
|
||||
export async function getUsers<T extends boolean | undefined = undefined>(
|
||||
|
|
|
@ -2,20 +2,30 @@ import { StyleSheet } from "react-native";
|
|||
|
||||
export const styles = StyleSheet.create({
|
||||
container: {
|
||||
display: "flex",
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
display: "flex"
|
||||
},
|
||||
code: {
|
||||
color: "white",
|
||||
fontSize: 40
|
||||
color: "#304270",
|
||||
fontSize: 40,
|
||||
margin: "auto",
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
},
|
||||
text: {
|
||||
color: "#6c7a8d",
|
||||
color: "#304270",
|
||||
fontSize: 20,
|
||||
margin: "auto",
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
},
|
||||
button: {
|
||||
color: "white",
|
||||
backgroundColor: "#323ea8"
|
||||
},
|
||||
buttonText: {
|
||||
textAlign: "center",
|
||||
fontWeight: "bold",
|
||||
color: "white"
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue