Skip to content

Commit

Permalink
[FE-Page] Add : NFT 사용 컴포넌트 구현 (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
gudals-kim committed Apr 5, 2024
1 parent fa700fb commit d536153
Show file tree
Hide file tree
Showing 11 changed files with 641 additions and 32 deletions.
4 changes: 4 additions & 0 deletions .idea/.gitignore

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

223 changes: 223 additions & 0 deletions app/frontend/package-lock.json

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

1 change: 1 addition & 0 deletions app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@coral-xyz/anchor": "^0.28.0",
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-native-clipboard/clipboard": "^1.14.0",
"@react-native-community/blur": "^4.4.0",
"@react-native-community/datetimepicker": "^7.6.3",
"@react-native-firebase/app": "^19.0.1",
Expand Down
10 changes: 4 additions & 6 deletions app/frontend/src/api/web3/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ export async function eventListFindByWallet(props: {
export async function doEvent(props: {
connection: any;
anchorWallet: any;
myWalletAddress: PublicKey;
eventAddress: PublicKey;
nftAddress: PublicKey;
myWalletAddress: PublicKey; // 내 지갑 주소
eventAddress: PublicKey; //이벤트 주소
nftAddress: PublicKey; //사용할 nft 주소
}) {
const provider = new AnchorProvider(props.connection, props.anchorWallet, {
preflightCommitment: 'confirmed',
Expand Down Expand Up @@ -151,9 +151,7 @@ export async function doEvent(props: {
.signers([entry])
.rpc();

const res = await processEventEntryTicketUsage(tx);

return res;
return await processEventEntryTicketUsage(tx);
}

export const processEventEntryTicketUsage = async (tx: string) => {
Expand Down
8 changes: 6 additions & 2 deletions app/frontend/src/components/list/EventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ import {FlatList, TouchableOpacity} from 'react-native-gesture-handler';
import SingerProfile from '../card/SingerProfile.tsx';
import {useEffect, useState} from 'react';
import moment from 'moment';
import {useNavigation} from '@react-navigation/native';

export default function EventList(props: {events: Array<any>}) {
const [timer, setTimer] = useState('');
const [startTime, setStartTime] = useState('');
const [endTime, setEndTime] = useState('');

const navigation = useNavigation();
useEffect(() => {
const interval = setInterval(() => {
const now = moment();
Expand Down Expand Up @@ -91,7 +92,10 @@ export default function EventList(props: {events: Array<any>}) {
</View>
</View>
<TouchableOpacity
onPress={item.onPress}
onPress={() => {
console.log('item = ', item);
navigation.navigate('SelectNft', {...item});
}}
style={{
width: '100%',
height: 40,
Expand Down
Loading

0 comments on commit d536153

Please sign in to comment.