Skip to content

Commit

Permalink
Merge pull request #217 from hackdays-io/feature/assignrole
Browse files Browse the repository at this point in the history
ロールのアサイン画面のコーディング
  • Loading branch information
yu23ki14 authored Dec 20, 2024
2 parents c87b351 + 77dd3c5 commit 0a5bbac
Show file tree
Hide file tree
Showing 13 changed files with 589 additions and 1,665 deletions.
4 changes: 3 additions & 1 deletion pkgs/frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ VITE_PINATA_GATEWAY=

VITE_PINATA_GATEWAY_TOKEN="M-iEBglWoUCZWJYsihe1IRrngs7HIGeIr3s5lObVw96hv7GTuCw1QrlmnNtwvuXt"

VITE_NAMESTONE_API_KEY=
VITE_NAMESTONE_API_KEY=

VITE_GOLDSKY_GRAPHQL_ENDPOINT=
120 changes: 110 additions & 10 deletions pkgs/frontend/abi/hatsTimeFrameModule.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
export const HATS_TIME_FRAME_MODULE_ABI = [
{
inputs: [
{
internalType: "address",
name: "_trustedForwarder",
type: "address",
},
{
internalType: "string",
name: "_version",
Expand Down Expand Up @@ -64,6 +59,48 @@ export const HATS_TIME_FRAME_MODULE_ABI = [
stateMutability: "pure",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "hatId",
type: "uint256",
},
{
internalType: "address",
name: "wearer",
type: "address",
},
],
name: "deactivate",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
{
internalType: "address",
name: "",
type: "address",
},
],
name: "deactivatedTime",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
Expand Down Expand Up @@ -127,13 +164,18 @@ export const HATS_TIME_FRAME_MODULE_ABI = [
},
{
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
{
internalType: "address",
name: "forwarder",
name: "",
type: "address",
},
],
name: "isTrustedForwarder",
name: "isActive",
outputs: [
{
internalType: "bool",
Expand All @@ -156,12 +198,35 @@ export const HATS_TIME_FRAME_MODULE_ABI = [
name: "wearer",
type: "address",
},
{
internalType: "uint256",
name: "time",
type: "uint256",
},
],
name: "mintHat",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "hatId",
type: "uint256",
},
{
internalType: "address",
name: "wearer",
type: "address",
},
],
name: "reactivate",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
Expand All @@ -176,15 +241,26 @@ export const HATS_TIME_FRAME_MODULE_ABI = [
type: "function",
},
{
inputs: [],
name: "trustedForwarder",
outputs: [
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
{
internalType: "address",
name: "",
type: "address",
},
],
name: "totalActiveTime",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
Expand Down Expand Up @@ -214,4 +290,28 @@ export const HATS_TIME_FRAME_MODULE_ABI = [
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
{
internalType: "address",
name: "",
type: "address",
},
],
name: "woreTime",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
] as const;
7 changes: 5 additions & 2 deletions pkgs/frontend/app/components/common/CommonInput.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import { Input, InputProps } from "@chakra-ui/react";
import { FC } from "react";

interface CommonInputProps extends Omit<InputProps, "value"> {
minHeight?: string;
value: string | number;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
}

export const CommonInput = ({
export const CommonInput: FC<CommonInputProps> = ({
minHeight,
value,
placeholder,
onChange,
}: CommonInputProps) => {
...rest
}) => {
return (
<Input
value={value}
placeholder={placeholder}
width="100%"
minHeight={minHeight}
onChange={onChange}
{...rest}
borderColor="gray.800"
borderRadius="xl"
backgroundColor="white"
Expand Down
81 changes: 43 additions & 38 deletions pkgs/frontend/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { useInjectStyles } from "./emotion/emotion-client";
import { PrivyProvider } from "@privy-io/react-auth";
import { Box, Container } from "@chakra-ui/react";
import { Header } from "./components/Header";
import { ApolloProvider } from "@apollo/client/react";
import { goldskyClient } from "utils/apollo";

interface LayoutProps extends React.PropsWithChildren {}

export const Layout = withEmotionCache((props: LayoutProps, cache) => {
Expand Down Expand Up @@ -43,52 +46,54 @@ export const Layout = withEmotionCache((props: LayoutProps, cache) => {

export default function App() {
return (
<PrivyProvider
appId={import.meta.env.VITE_PRIVY_APP_ID}
config={{
embeddedWallets: {
createOnLogin: "users-without-wallets",
},
}}
>
<ChakraProvider>
{/* DarkMode 切り替えの実装の可能性に備え、ThemeProvider を残しておいてあります */}
{/* <ThemeProvider disableTransitionOnChange attribute="class"> */}
<ApolloProvider client={goldskyClient}>
<PrivyProvider
appId={import.meta.env.VITE_PRIVY_APP_ID}
config={{
embeddedWallets: {
createOnLogin: "users-without-wallets",
},
}}
>
<ChakraProvider>
{/* DarkMode 切り替えの実装の可能性に備え、ThemeProvider を残しておいてあります */}
{/* <ThemeProvider disableTransitionOnChange attribute="class"> */}

<Box
bg="gray.50"
width="100%"
height="100vh"
display="flex"
justifyContent="center"
overflow="auto"
>
<Container
bg="#fffdf8"
maxW="430px"
height="100%"
<Box
bg="gray.50"
width="100%"
px={5}
py={4}
height="100vh"
display="flex"
flexDirection="column"
alignItems="center"
position="relative"
justifyContent="center"
overflow="auto"
>
<Header />
<Box
width="100%"
<Container
bg="#fffdf8"
maxW="430px"
height="100%"
width="100%"
px={5}
py={4}
display="flex"
flexDirection="column"
alignItems="center"
position="relative"
>
<Outlet />
</Box>
</Container>
</Box>
{/* </ThemeProvider> */}
</ChakraProvider>
</PrivyProvider>
<Header />
<Box
width="100%"
height="100%"
display="flex"
flexDirection="column"
position="relative"
>
<Outlet />
</Box>
</Container>
</Box>
{/* </ThemeProvider> */}
</ChakraProvider>
</PrivyProvider>
</ApolloProvider>
);
}
Loading

0 comments on commit 0a5bbac

Please sign in to comment.