Move hooks folder (#68)
This commit is contained in:
parent
59be0ec826
commit
bdf53d556f
|
@ -13,7 +13,7 @@ import binIcon from '../assets/images/bin.svg'
|
|||
import { RemoveModal } from './card/RemoveModal'
|
||||
import { useEthers } from '@usedapp/core'
|
||||
import { useContractFunction } from '@usedapp/core'
|
||||
import { useContracts } from './hooks/useContracts'
|
||||
import { useContracts } from '../hooks/useContracts'
|
||||
import { getVotingWinner } from '../helpers/voting'
|
||||
|
||||
interface CardCommunityProps {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FeatureModal } from './FeatureModal'
|
|||
import { VoteConfirmModal } from './VoteConfirmModal'
|
||||
import { OngoingVote } from './OngoingVote'
|
||||
import { useEthers } from '@usedapp/core'
|
||||
import { useContracts } from '../hooks/useContracts'
|
||||
import { useContracts } from '../../hooks/useContracts'
|
||||
import { useContractCall } from '@usedapp/core'
|
||||
|
||||
interface CardFeatureProps {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ConfirmBtn } from './VoteConfirmModal'
|
|||
|
||||
import { useContractFunction } from '@usedapp/core'
|
||||
|
||||
import { useContracts } from '../hooks/useContracts'
|
||||
import { useContracts } from '../../hooks/useContracts'
|
||||
|
||||
interface ProposeModalProps {
|
||||
availableAmount: number
|
||||
|
|
|
@ -5,7 +5,7 @@ import { ButtonSecondary } from '../Button'
|
|||
import { CurrentVoting } from '../../models/community'
|
||||
import { VotePropose } from '../votes/VotePropose'
|
||||
import { VoteType } from '../../constants/voteTypes'
|
||||
import { useSendWakuVote } from '../hooks/useSendWakuVote'
|
||||
import { useSendWakuVote } from '../../hooks/useSendWakuVote'
|
||||
|
||||
export interface VoteModalProps {
|
||||
vote: CurrentVoting
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Card, CardCommunity, CardCommunityWrap, CardVoteWrap } from '../Card'
|
|||
import { CardFeature } from '../card/CardFeature'
|
||||
import styled from 'styled-components'
|
||||
import { CommunityDetail, DirectorySortingEnum } from '../../models/community'
|
||||
import { useCommunities } from '../hooks/useCommunities'
|
||||
import { useCommunities } from '../../hooks/useCommunities'
|
||||
import { getCommunitiesInDirectory } from '../../helpers/apiMock'
|
||||
import { FilterList } from '../Filter'
|
||||
import { Search } from '../Input'
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { useContractFunction } from '@usedapp/core'
|
||||
import React from 'react'
|
||||
import { Card, CardCommunity, CardCommunityWrap, CardVote, CardVoteWrap } from '../Card'
|
||||
import { useCommunity } from '../hooks/useCommunity'
|
||||
import { useContracts } from '../hooks/useContracts'
|
||||
import { useVotesAggregate } from '../hooks/useVotesAggregate'
|
||||
import { useCommunity } from '../../hooks/useCommunity'
|
||||
import { useContracts } from '../../hooks/useContracts'
|
||||
import { useVotesAggregate } from '../../hooks/useVotesAggregate'
|
||||
import { VotingCardSkeleton } from './VotingCardSkeleton'
|
||||
|
||||
interface VotingCardProps {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { VotingCard } from './VotingCard'
|
|||
import { Search } from '../Input'
|
||||
import { useContractCall } from '@usedapp/core'
|
||||
import { VotingSortingOptions } from '../../constants/SortingOptions'
|
||||
import { useContracts } from '../hooks/useContracts'
|
||||
import { useContracts } from '../../hooks/useContracts'
|
||||
|
||||
export function VotingCards() {
|
||||
const { votingContract } = useContracts()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { useState, useEffect } from 'react'
|
||||
import { CommunityDetail } from '../../models/community'
|
||||
import { APIOptions, APIFunction } from './../../models/api'
|
||||
import { CommunityDetail } from '../models/community'
|
||||
import { APIOptions, APIFunction } from './../models/api'
|
||||
|
||||
export function useCommunities(API: APIFunction, options: APIOptions) {
|
||||
const [communities, setCommunities] = useState<CommunityDetail[]>([])
|
|
@ -1,9 +1,9 @@
|
|||
import { useContractCall } from '@usedapp/core'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { getCommunityDetails } from '../../helpers/apiMock'
|
||||
import { CommunityDetail } from '../../models/community'
|
||||
import { getCommunityDetails } from '../helpers/apiMock'
|
||||
import { CommunityDetail } from '../models/community'
|
||||
import { useContracts } from './useContracts'
|
||||
import voting from '../../helpers/voting'
|
||||
import voting from '../helpers/voting'
|
||||
|
||||
export function useCommunity(room: number) {
|
||||
const { votingContract } = useContracts()
|
|
@ -1,5 +1,5 @@
|
|||
import { useEthers } from '@usedapp/core'
|
||||
import { useConfig } from '../../providers/config'
|
||||
import { useConfig } from '../providers/config'
|
||||
import { Contract } from '@usedapp/core/node_modules/ethers'
|
||||
import { Interface } from '@ethersproject/abi'
|
||||
import { MockContract } from '@status-community-dapp/contracts/abi'
|
|
@ -1,8 +1,8 @@
|
|||
import { useCallback } from 'react'
|
||||
import { useWaku } from '../../providers/waku/provider'
|
||||
import { useWaku } from '../providers/waku/provider'
|
||||
import { useEthers } from '@usedapp/core'
|
||||
import { useConfig } from '../../providers/config'
|
||||
import { createWakuMessage } from '../../helpers/wakuMessage'
|
||||
import { useConfig } from '../providers/config'
|
||||
import { createWakuMessage } from '../helpers/wakuMessage'
|
||||
|
||||
export function useSendWakuVote() {
|
||||
const { waku } = useWaku()
|
|
@ -1,10 +1,10 @@
|
|||
import { useState, useEffect } from 'react'
|
||||
import { useWaku } from '../../providers/waku/provider'
|
||||
import { useWaku } from '../providers/waku/provider'
|
||||
import { useContractCall } from '@usedapp/core'
|
||||
import { useConfig } from '../../providers/config'
|
||||
import { useConfig } from '../providers/config'
|
||||
import { useContracts } from '../hooks/useContracts'
|
||||
|
||||
import wakuMessage from '../../helpers/wakuMessage'
|
||||
import wakuMessage from '../helpers/wakuMessage'
|
||||
|
||||
export function useVotesAggregate(room: number) {
|
||||
const { config } = useConfig()
|
Loading…
Reference in New Issue