Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustment to write testimony flow (update of #1440) #1565

Merged
merged 14 commits into from
Jun 5, 2024
Prev Previous commit
Next Next commit
adjust SelectRecipients
  • Loading branch information
mertbagt committed May 24, 2024
commit e2e95a8dd922bd43170c12ec2ef537b4f965f84a
45 changes: 26 additions & 19 deletions components/publish/SelectRecipients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { cloneDeep, fromPairs, isString, last, sortBy } from "lodash"
import { useEffect } from "react"
import { components, GroupBase, MultiValueGenericProps } from "react-select"
import styled from "styled-components"
import { Button } from "../bootstrap"
import { Button, Col, Row } from "../bootstrap"
import { CopyButton } from "../buttons"
import { useMemberSearch } from "../db"
import { useProfileState } from "../db/profile/redux"
Expand All @@ -25,14 +25,34 @@ import {

export const SelectRecipients = styled(props => {
useEmailRecipients()
const email = useTestimonyEmail()

return (
<div {...props}>
<div className="d-flex justify-content-between">
<div className="fs-4">Email Recipients</div>
<RecipientControls />
</div>
<SelectLegislatorEmails className="mt-2" />
<Row className="d-flex">
<Col className="fs-4" md={9} xs={12}>
Email Recipients
</Col>
<Col md={3} xs={12}>
<RecipientControls />
</Col>
</Row>
<SelectLegislatorEmails className="my-2" />
<Row className="d-flex">
<Col md={3}>
{email.to ? (
<CopyButton
key="copy"
variant="outline-secondary"
text={email.to}
className="copy py-1 px-2"
format="text/plain"
>
<FontAwesomeIcon icon={faCopy} /> Copy Email Recipients
</CopyButton>
) : null}
</Col>
</Row>
</div>
)
})`
Expand Down Expand Up @@ -103,19 +123,6 @@ const RecipientControls = styled(({ className }) => {
</Button>
)

if (email.to)
buttons.push(
<CopyButton
key="copy"
variant="outline-secondary"
text={email.to}
className="copy"
format="text/plain"
>
<FontAwesomeIcon icon={faCopy} /> Copy Email Recipients
</CopyButton>
)

return <div className={clsx("d-flex gap-4", className)}>{buttons}</div>
})`
flex-wrap: wrap;
Expand Down
20 changes: 5 additions & 15 deletions components/publish/SubmitTestimonyForm.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
import clsx from "clsx"
import { useState } from "react"
import styled from "styled-components"
import {
Col,
Container,
Image,
Row,
Spinner,
Button,
Collapse,
Modal
} from "../bootstrap"
import { useMediaQuery } from "usehooks-ts"

import { Col, Image, Row, Spinner, Collapse } from "../bootstrap"
import { Bill, Profile } from "../db"
import * as links from "../links"
import { ChooseStance } from "./ChooseStance"
import { useFormInfo } from "./hooks"
import { useState } from "react"
import { useMediaQuery } from "usehooks-ts"
import { KeepNote, KeepNoteMobile } from "./KeepNote"
import { ProgressBar } from "./ProgressBar"
import { PublishInfo } from "./PublishInfo"
import { PublishTestimony } from "./PublishTestimony"
import { QuickInfo } from "./QuickInfo"
import { Step } from "./redux"
import { SelectLegislatorsCta } from "./SelectLegislatorsCta"
import { ShareTestimony } from "./ShareTestimony"
import { WriteTestimony } from "./WriteTestimony"
import { KeepNote, KeepNoteMobile } from "./KeepNote"

const Background = styled.div`
background: var(--bs-white);
Expand Down Expand Up @@ -56,7 +47,6 @@ export const SubmitTestimonyForm = () => {
)}
</Col>
</Row>
{/* </StyledContainer> */}
</Background>
) : (
<Spinner animation="border" />
Expand Down