833dd37469
* Add tip arrows UI (visual) * move tipper into its own component * simplify score calculation * Add tip txns - more specific txn types - fix transact cloud function to be able to create tip txns - insert tips into comments via a context * Refactor tipper to send tip txns * Stop tipping yourself. Disable anons. * Style tipper (smaller) * remove default exports * capitalize tooltips * rename stuff * add exhausting hook dependencies * replace context with prop threading * fix eslint unused vars * fix: thread tips correctly into fr comments
14 lines
364 B
TypeScript
14 lines
364 B
TypeScript
import { useEffect, useState } from 'react'
|
|
import { DonationTxn } from 'common/txn'
|
|
import { listenForCharityTxns } from 'web/lib/firebase/txns'
|
|
|
|
export const useCharityTxns = (charityId: string) => {
|
|
const [txns, setTxns] = useState<DonationTxn[]>([])
|
|
|
|
useEffect(() => {
|
|
return listenForCharityTxns(charityId, setTxns)
|
|
}, [charityId])
|
|
|
|
return txns
|
|
}
|