MCPcopy Create free account

hub / github.com/defund12/defund12.org / functions

Functions71 in github.com/defund12/defund12.org

↓ 7 callersMethodmarkdownToHTML
* Renders markdown to HTML using remark-html. * @param {string} value a markdown string to render to HTML. * @return {string} an HTML string
src/DefundUtils.ts:17
↓ 5 callersFunctionsetAddress
Callback for when part of user's address is updated. * adds it to the full address in our internal state and * calls the parent's callback *
src/components/letter/MyAddressInput.tsx:26
↓ 4 callersMethodcopyToClipboard
* Temporarily creates a <textarea> in the browser and copies its content. * @param {string} copyText the text to copy. * @param {boolean} isPerm
src/DefundUtils.ts:34
↓ 3 callersMethodhandleClipboardCopy
* Updates the component state to reflect which element was clicked. * @param {Pick<EmailState, K>} statePatch an object containing * the state
src/components/email/Email.tsx:97
↓ 2 callersFunctioncreateEmailOrLetterTemplatePage
Shared logic between creating email and letter pages
gatsby-node.ts:12
↓ 2 callersFunctionisTestMode
()
src/components/letter/LetterUtils.ts:5
↓ 2 callersFunctionlobAddressToSingleLine
(address: LobAddress)
src/components/letter/LobAddressUtils.ts:56
↓ 2 callersFunctionofficialAddressToLobAddress
( officialAddress: OfficialAddress )
src/components/letter/LobAddressUtils.ts:22
↓ 2 callersFunctionshouldUseOfficial
({ restricts, levels, roles, }: ShouldUseOfficialParams)
src/services/AbstractRepresentativeFetchingService.ts:26
↓ 2 callersFunctionupdateField
When user-inputted fields change, update them in our variable map, * and (try) to update the body text If the user has edited the template, t
src/components/letter/LetterForm.tsx:116
↓ 1 callersFunctionblackmadCityCouncilEntryToOfficialAddresses
convert an entry from blackmad's city council api into unifed OfficialAddress structure * * officials sometimes have multiple offices, like in their
src/services/BlackmadCityCouncilService.tsx:47
↓ 1 callersFunctionblackmadCityCouncilResponseToOfficialAddresses
convert an entire response from blackmad's city council API to OfficialAddresses * * @param {BlackmadCityCouncilResponse} cityCouncilMembers the API
src/services/BlackmadCityCouncilService.tsx:79
↓ 1 callersMethodfetch
fetch officials from blackmad's city council API * * @param {BaseOfficialApiParams} input params * @return {Promise<OfficialAddress[]>} addre
src/services/BlackmadCityCouncilService.tsx:108
↓ 1 callersMethodfetch
fetch officials from google & blackmad APIs based on user address * * @param {FetchOfficialsParams} params input params * @return {Promise<Of
src/services/CombinedOfficialFetchingService.ts:36
↓ 1 callersMethodfetch
fetch officials from google civic info API * @param {FetchOfficialsParams} input params * @return {Promise<OfficialAddress[]>} addresses of offi
src/services/GoogleCivicInformationApiService.ts:125
↓ 1 callersFunctiongoogleCivicRepsOfficialToOfficialAddresses
convert one official from google's civic info API to OfficialAddresses * * @param {GoogleCivicRepsResponseOffice} office the office of the official
src/services/GoogleCivicInformationApiService.ts:25
↓ 1 callersFunctiongoogleCivicRepsResponseToOfficialAddresses
convert an entire response from google's civic info API to OfficialAddresses * * @param {GoogleCivicRepsResponse} reps the API response to convert
src/services/GoogleCivicInformationApiService.ts:56
↓ 1 callersFunctiongroupTemplateMetadataByState
* Groups the array of email metadata passed to it by state * and assigns each state an ID number. * @param {Array<SharedTemplateMetadata>} metadata
src/components/template-list/TemplateList.tsx:133
↓ 1 callersFunctionisCityCouncilOffical
Is this offical a city council person * * @param {LevelsAndRoles} official offical to check * @return {boolean} is this offical a city council pers
src/services/CombinedOfficialFetchingService.ts:16
↓ 1 callersFunctionmakeAddressLine
(parts: string[])
src/components/letter/LobAddressUtils.ts:9
↓ 1 callersFunctionmakeButtonText
Generates the text in the checkout button to reflect what the user needs to do to get it enabled * or what the total cost is * * @return {str
src/components/letter/CheckoutForm.tsx:98
↓ 1 callersFunctionofficialAddressToSingleLine
( officialAddress: OfficialAddress )
src/components/letter/LobAddressUtils.ts:45
↓ 1 callersFunctiononAddressSelected
Callback for when a user clicks a checkbox on an address so we * can update our list of currently checked addresses * @param {boolean} isChecked
src/components/letter/LetterForm.tsx:152
↓ 1 callersMethodopenEmail
* Redirects the browser to a mailto: link containing the email information
src/components/email/Email.tsx:78
↓ 1 callersFunctionparseVars
parses out the [SOME VARIABLE] names from template, minus the ones mentioned in SpecialVars * ensure there is a key that a user can enter their email
src/components/letter/LetterForm.tsx:27
↓ 1 callersMethodrenderEmailLinks
* Renders each email definition it is passed into an email page link. * @param {Array<SharedTemplateMetadata>} data * An array of objects cont
src/components/template-list/TemplateList.tsx:68
FunctionCheckoutForm
({ checkedAddresses, myAddress, body, allVariablesFilledIn, email, }: CheckoutFormProps)
src/components/letter/CheckoutForm.tsx:34
FunctionEmailList
()
src/components/template-list/EmailList.tsx:7
FunctionFooter
()
src/components/common/Footer.tsx:82
FunctionHeader
()
src/components/common/Header.tsx:33
FunctionLayout
( props: React.PropsWithChildren<OptionalLayoutProps> )
src/components/common/Layout.tsx:79
FunctionLetterForm
Renders the overall letter sending form * * @param {LetterFormProps} the component props * @return {ReactElement} the rendered component
src/components/letter/LetterForm.tsx:62
FunctionLetterList
()
src/components/template-list/LetterList.tsx:7
FunctionMyAddressInput
({ updateAddress, }: MyAddressInputProps)
src/components/letter/MyAddressInput.tsx:15
FunctionOfficalAddressCheckbox
({ officialAddress, onAddressSelected, }: OfficialAddressCheckboxProps)
src/components/letter/OfficialAddressCheckbox.tsx:21
FunctionOfficialAddressCheckboxList
({ addresses, onAddressSelected, officials, myAddress, }: OfficialAddressCheckboxListProps)
src/components/letter/OfficialAddressCheckboxList.tsx:23
FunctionTemplateInputs
({ variables, updateField, }: TemplateInputProps)
src/components/letter/TemplateInputs.tsx:17
FunctionTemplateList
({ layout, header, }: TemplateListParams)
src/components/template-list/TemplateList.tsx:184
MethodcomponentDidMount
* React client-side mount method.
src/components/email/Email.tsx:58
Methodconstructor
* Create a group containing emails. * @param {string} name the state name. * @param {Array<SharedTemplateMetadata>} templates the state's emails
src/types/TemplateData.ts:110
Methodconstructor
* Initialize the component and its state. * @param {PageProps<EmailProps>} props
src/components/email/Email.tsx:39
Methodconstructor
* Initialize the component and its state. * @param {PageProps<EmailProps>} props
src/components/letter/Letter.tsx:28
Methodconstructor
* Initialize the component. * @param {FooterProps} props
src/components/common/Footer.tsx:17
Methodconstructor
* Initialize the component and its state. * @param {TemplateListItemProps} props
src/components/template-list/TemplateListItem.tsx:24
Methodconstructor
* Initialize the list component along with its filter options. * @param {TemplateListProps} props
src/components/template-list/TemplateList.tsx:44
Methodconstructor
* Initialize the component. * @param {PageProps<SiteProps>} props
src/pages/letters.tsx:16
Methodconstructor
* Initialize the component. * @param {PageProps<SiteProps>} props
src/pages/index.tsx:15
Methodconstructor
({ levels, roles, address, link, officeName, name, email, }: OfficialAddressPara
src/services/OfficialTypes.ts:84
Methodconstructor
constructor * @param {string} googleApiKey a google api key with civic info api perms
src/services/CombinedOfficialFetchingService.ts:29
Methodconstructor
constructor * @param {string} googleApiKey a google api key with civic info api perms
src/services/GoogleCivicInformationApiService.ts:119
FunctioncreatePages
({ actions, graphql, reporter, })
gatsby-node.ts:4
Methodfetch
(params: FetchOfficialsParams)
src/services/AbstractRepresentativeFetchingService.ts:46
MethodhandleClipboardCopy
* Handles changing the component state appropriately before copying * link content.
src/components/template-list/TemplateListItem.tsx:35
FunctionhandleSubmit
Handles checkout submit click * * @param {React.SyntheticEvent} event the click even
src/components/letter/CheckoutForm.tsx:48
FunctionisEmailData
( emailDataOrMetadata: SharedTemplateMetadata & EmailData )
src/types/TemplateData.ts:89
FunctiononBodyTextKeyPress
If the user edits the textarea, mark it dirty and set the new body text * @param {ChangeEvent} event the event generated by use typing into the bod
src/components/letter/LetterForm.tsx:142
FunctiononChange
( event: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement> )
src/components/letter/TemplateInputs.tsx:24
FunctiononChange
(event: React.ChangeEvent<HTMLInputElement>)
src/components/letter/OfficialAddressCheckbox.tsx:25
MethodonStateSelectionChanged
* Updates component state with the currently selected geographical state. * @param {ReactSelectOption} selectedState * The option object of th
src/components/template-list/TemplateList.tsx:81
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/components/email/Email.tsx:109
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/components/letter/Letter.tsx:48
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/components/common/Layout.tsx:19
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/components/common/Header.tsx:16
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/components/common/Footer.tsx:25
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/components/template-list/TemplateListItem.tsx:44
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/components/template-list/TemplateList.tsx:89
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/pages/letterSuccess.tsx:14
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/pages/letters.tsx:24
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/pages/404.tsx:14
Methodrender
* React render method. * @return {React.ReactNode} the rendered component
src/pages/index.tsx:23
FunctionupdateMyAddress
This is the handler we pass to the user address MyAddressInput sub-component * @param {Address} address the user inputted address
src/components/letter/LetterForm.tsx:167