Never dealing with this again

This commit is contained in:
niku 2023-06-10 19:54:00 +02:00
parent b4b49351f8
commit b2a48861e7
6 changed files with 44 additions and 13 deletions

3
.env.sample Normal file
View File

@ -0,0 +1,3 @@
DEFAUL_PVE_URL=
DEFAUL_PVE_USER=
DEFAUL_PVE_PASSWORD=

3
.gitignore vendored
View File

@ -12,3 +12,6 @@ web-build/
# macOS
.DS_Store
# secrets
.env

View File

@ -1,11 +1,18 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
"@babel/plugin-proposal-export-namespace-from",
"react-native-reanimated/plugin",
require.resolve("expo-router/babel"),
],
};
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
"@babel/plugin-proposal-export-namespace-from",
"react-native-reanimated/plugin",
require.resolve("expo-router/babel"),
[
"module:react-native-dotenv",
{
moduleName: "react-native-dotenv",
verbose: false,
},
],
],
};
};

View File

@ -10,6 +10,11 @@ import React, { useState } from "react";
import tw from "twrnc";
import useAuthStore from "../../stores/useAuthStore";
import { useTicketMut } from "../../hooks/useTicket";
import {
DEFAUL_PVE_URL,
DEFAUL_PVE_USER,
DEFAUL_PVE_PASSWORD,
} from "react-native-dotenv";
interface FormFieldProps extends TextInputProps {
label: string;
@ -41,9 +46,9 @@ export function FormField({
}
export default function Login() {
const [domain, setDomain] = useState("https://pve.holowaif.us:8006");
const [username, setUsername] = useState("root@pam");
const [password, setPassword] = useState("7eji5TXjVpme2ZPd6zMUwmrPkg2gQFJc");
const [domain, setDomain] = useState(DEFAUL_PVE_URL ?? "");
const [username, setUsername] = useState(DEFAUL_PVE_USER ?? "");
const [password, setPassword] = useState(DEFAUL_PVE_PASSWORD ?? "");
const authStore = useAuthStore();
const ticketMut = useTicketMut({

View File

@ -37,6 +37,7 @@
"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"react-native-dotenv": "^3.4.8",
"rome": "^11.0.0"
},
"resolutions": {
@ -50,4 +51,4 @@
"name": "pvern",
"version": "1.0.0",
"private": true
}
}

View File

@ -3212,6 +3212,11 @@ dlv@^1.1.3:
resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"
integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==
dotenv@^16.0.3:
version "16.1.4"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.1.4.tgz#67ac1a10cd9c25f5ba604e4e08bc77c0ebe0ca8c"
integrity sha512-m55RtE8AsPeJBpOIFKihEmqUcoVncQIwo7x9U8ZwLEZw9ZpXboz2c+rvog+jUaJvVrZ5kBOeYQBX5+8Aa/OZQw==
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
@ -6122,6 +6127,13 @@ react-native-codegen@^0.71.5:
jscodeshift "^0.13.1"
nullthrows "^1.1.1"
react-native-dotenv@^3.4.8:
version "3.4.8"
resolved "https://registry.yarnpkg.com/react-native-dotenv/-/react-native-dotenv-3.4.8.tgz#42284070a9994076cd700805c2dd28051c9e1432"
integrity sha512-fg9F8X/cG1kDTwRLgLz3t+AMbsULoFHbUVltdQarmrJ3kNllD1Zq7ZgY85bp8BnPwk0DnYQzKbooiLsUoKd10w==
dependencies:
dotenv "^16.0.3"
react-native-gesture-handler@~2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.9.0.tgz#2f63812e523c646f25b9ad660fc6f75948e51241"