Skip to content

Commit

Permalink
Minor Update
Browse files Browse the repository at this point in the history
- Added react-hook-form
- Fixed up footer
  • Loading branch information
h0lybyte committed Oct 1, 2023
1 parent 694fad5 commit 37ea6be
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 8 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2023 KBVE.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# widget-template-yorha-ui
# YoRHa UI Widget

This is just a proof of concept for a small widget style RPG for me to have a bit of fun learning Appwrite functions!
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0",
"react-hook-form": "^7.46.2",
"styled-components": "^6.0.7",
"tailwindcss": "^3.3.3",
"twin.macro": "^3.4.0"
Expand Down
6 changes: 3 additions & 3 deletions src/KBVE.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const KBVE = () => {
>
<div tw="flex justify-between pb-4 ">
<div tw="flex items-center space-x-4 scale-75 md:scale-90">
<VE.berserkButton scene="menu" text="Menu" />
<VE.berserkButton scene="ship" text="Ship" />
<VE.BerserkButton scene="menu" text="Menu" />
<VE.BerserkButton scene="ship" text="Ship" />
</div>
<VE.shitOnMemeButton
scene="main"
Expand Down Expand Up @@ -56,7 +56,7 @@ export const KBVE = () => {

</div>
<div tw="space-x-2 flex flex-row scale-75 md:scale-90">
<VE.berserkButton action="register" text="Register" />
<VE.Footer />
</div>
<VE.deployModal />
</div>
Expand Down
43 changes: 39 additions & 4 deletions src/VE.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { task } from "nanostores";
import { useStore } from "@nanostores/react";
import React from "react";
import { Client, Account } from "appwrite";
import { action$, scene$, load$, kbve$, modal$ } from "./KB";
import { action$, scene$, load$, kbve$, modal$, member$ } from "./KB";
import tw, { styled } from "twin.macro";
import { Helmet } from "react-helmet-async";
import { useForm } from "react-hook-form";

//? [API]

Expand Down Expand Up @@ -88,7 +89,7 @@ export const zeroCool = () => {
});
};

//TODO [LISTEN]
//? [LISTEN]

action$.subscribe((value) => {
switch (value) {
Expand All @@ -113,6 +114,12 @@ action$.subscribe((value) => {
case "register":
Tasker("modal", "register");
return;
case "app":
Tasker("modal", "app");
return;
case "auth":
console.log("[Modal] -> [AUTH]")
return;
}
});

Expand All @@ -122,7 +129,7 @@ export const DX = () => {};

//? [UI]

export const berserkButton = ({ scene = "", text, action = "" }) => {
export const BerserkButton = ({ scene = "", text, action = "" }) => {
const handleClick = async () => {
if (scene.length > 2) Tasker("scene", scene);
if (action.length > 2) Tasker("action", action);
Expand Down Expand Up @@ -265,7 +272,7 @@ export const MenuScreen = () => {
return (
<>
<Wrap text="Menu">
<ShutterButton action="register" text="DE" />
<ShutterButton action="stats" text="Stats" />
<ShutterButton action="de" text="DE" />
<ShutterButton action="fr" text="FR" />
</Wrap>
Expand All @@ -275,9 +282,30 @@ export const MenuScreen = () => {

//? [MODAL]

//! [FOOTER]
export const Footer = () => {
const $member = useStore(member$);

if(!$member)
return (
<>
<BerserkButton action="register" text="Register" />
<BerserkButton action="app" text="KBVE" />
</>
)
else {
<>
</>
}
}


export const deployModal = () => {
const $modal = useStore(modal$);

const { register, handleSubmit } = useForm()


if(!$modal) {
return <></>
}
Expand All @@ -304,6 +332,13 @@ export const deployModal = () => {
Petals
</ModalWrap>
</>
case "app":
return <>
<ModalWrap title="KBVE">
Appwrite: v1.4.3
YoRHa : {version}
</ModalWrap>
</>
default:
return <></>
}
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3273,6 +3273,11 @@ react-helmet-async@^1.3.0:
react-fast-compare "^3.2.0"
shallowequal "^1.1.0"

react-hook-form@^7.46.2:
version "7.46.2"
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.46.2.tgz#051e3cb2a73f3e86de739f2198c6042902158c43"
integrity sha512-x1DWmHQchV7x2Rq9l99M/cQHC8JGchAnw9Z0uTz5KrPa0bTl/Inm1NR7ceOARfIrkNuQNAhuSuZPYa6k7QYn3Q==

react-is@^16.13.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
Expand Down

0 comments on commit 37ea6be

Please sign in to comment.