Skip to content

Commit c2d6f3e

Browse files
authored
More Sidebar Tweaks (#1985)
* tweaks * additional changes * cleanup
1 parent 6ffeaed commit c2d6f3e

File tree

9 files changed

+67
-51
lines changed

9 files changed

+67
-51
lines changed

components/bill/Back.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/bill/BillDetails.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { useFlags } from "components/featureFlags"
1+
import { useTranslation } from "next-i18next"
22
import { useAuth } from "../auth"
33
import { Col, Container, Row } from "../bootstrap"
44
import { TestimonyFormPanel } from "../publish"
55
import { Banner } from "../shared/StyledSharedComponents"
6-
import { Back } from "./Back"
76
import { BillNumber, Styled } from "./BillNumber"
87
import { BillTestimonies } from "./BillTestimonies"
98
import BillTrackerConnectedView from "./BillTracker"
@@ -12,10 +11,11 @@ import { Committees, Hearing, Sponsors } from "./SponsorsAndCommittees"
1211
import { Status } from "./Status"
1312
import { Summary } from "./Summary"
1413
import { BillProps } from "./types"
15-
import { useTranslation } from "next-i18next"
16-
import { isCurrentCourt } from "functions/src/shared"
14+
import { Back } from "components/shared/CommonComponents"
15+
import { useFlags } from "components/featureFlags"
1716
import { FollowBillButton } from "components/shared/FollowButton"
1817
import { PendingUpgradeBanner } from "components/PendingUpgradeBanner"
18+
import { isCurrentCourt } from "functions/src/shared"
1919

2020
export const BillDetails = ({ bill }: BillProps) => {
2121
const { t } = useTranslation("common")

components/hearing/HearingDetails.tsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import { Transcriptions } from "./Transcriptions"
77
import { Col, Container, Image, Row } from "../bootstrap"
88
import { firestore } from "../firebase"
99
import * as links from "../links"
10+
import { Back } from "../shared/CommonComponents"
1011

1112
const ButtonContainer = styled.div`
1213
width: fit-content;
1314
`
1415

15-
export const CommitteeButton = styled.button`
16+
export const FeatureCalloutButton = styled.button`
1617
border-radius: 12px;
1718
font-size: 12px;
1819
`
@@ -43,6 +44,11 @@ export const HearingDetails = ({
4344
hearingId: string | string[] | undefined
4445
}) => {
4546
const { t } = useTranslation(["common", "hearing"])
47+
const [transcriptData, setTranscriptData] = useState(null)
48+
49+
const handleTranscriptData = (data: any) => {
50+
setTranscriptData(data)
51+
}
4652

4753
const [videoLoaded, setVideoLoaded] = useState(false)
4854
const handleVideoLoad = () => {
@@ -85,30 +91,32 @@ export const HearingDetails = ({
8591

8692
return (
8793
<Container className="mt-3 mb-3">
88-
<h1>
89-
{t("hearing", { ns: "hearing" })} {hearingId}
90-
</h1>
91-
92-
<h5 className={`mb-3`}>{description}</h5>
94+
<Row className={`mb-3`}>
95+
<Col>
96+
<Back href="/hearings">{t("back_to_hearings")}</Back>
97+
</Col>
98+
</Row>
9399

94-
{committeeName ? (
95-
<ButtonContainer>
100+
{transcriptData ? (
101+
<ButtonContainer className={`mb-2`}>
96102
{/* ButtonContainer contrains clickable area of link so that it doesn't exceed
97103
the button and strech invisibly across the width of the page */}
98-
<links.External
99-
href={`https://malegislature.gov/Committees/Detail/${committeeCode}/${generalCourtNumber}`}
104+
<FeatureCalloutButton
105+
className={`btn btn-secondary d-flex text-nowrap mt-1 mx-1 p-1`}
100106
>
101-
<CommitteeButton
102-
className={`btn btn-secondary d-flex text-nowrap mt-1 mx-1 p-1`}
103-
>
104-
&nbsp; {committeeName} &nbsp;
105-
</CommitteeButton>
106-
</links.External>
107+
&nbsp;{" "}
108+
{t("video_and_transcription_feature_callout", { ns: "hearing" })}{" "}
109+
&nbsp;
110+
</FeatureCalloutButton>
107111
</ButtonContainer>
108112
) : (
109113
<></>
110114
)}
111115

116+
{committeeName ? <h1>{committeeName}</h1> : <></>}
117+
118+
<h5 className={`mb-3`}>{description}</h5>
119+
112120
<Row>
113121
<Col className={`col-md-8 mt-4`}>
114122
<LegalContainer className={`pb-2 rounded`}>
@@ -160,6 +168,7 @@ export const HearingDetails = ({
160168
)}
161169

162170
<Transcriptions
171+
handleTranscriptData={handleTranscriptData}
163172
setCurTimeVideo={setCurTimeVideo}
164173
videoLoaded={videoLoaded}
165174
videoRef={videoRef}

components/hearing/Transcriptions.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,13 @@ const SearchWrapper = styled.div`
115115
`
116116

117117
export const Transcriptions = ({
118+
handleTranscriptData,
118119
setCurTimeVideo,
119120
videoLoaded,
120121
videoRef,
121122
videoTranscriptionId
122123
}: {
124+
handleTranscriptData: (data: any) => void
123125
setCurTimeVideo: any
124126
videoLoaded: boolean
125127
videoRef: any
@@ -149,6 +151,7 @@ export const Transcriptions = ({
149151

150152
if (transcriptData.length === 0 && docList.length != 0) {
151153
setTranscriptData(docList)
154+
handleTranscriptData(docList)
152155
}
153156
}, [subscriptionRef, transcriptData])
154157

components/shared/CommonComponents.tsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import styled from "styled-components"
22
import { Container } from "../bootstrap"
3+
import * as links from "../links"
34

45
export const MemberItem = ({
56
name,
@@ -21,11 +22,23 @@ export const MemberItem = ({
2122
)
2223
}
2324

24-
const StyledContainer = styled(Container)`
25-
//border-top: 1px solid #979797;
26-
background: white;
27-
border-radius: 0 0 10px 10px;
25+
export const Back = styled(links.Internal)`
26+
margin-right: auto;
2827
`
28+
29+
export const DescrContainer = styled.div`
30+
font-size: 16px;
31+
font-weight: 500;
32+
line-height: 20px;
33+
letter-spacing: 0.015em;
34+
text-align: left;
35+
`
36+
37+
export const Divider = styled.hr`
38+
border: 1px solid #979797;
39+
margin: 0;
40+
`
41+
2942
const EmailContainer = styled.a`
3043
color: #1a3185;
3144
font-size: 20px;
@@ -35,6 +48,7 @@ const EmailContainer = styled.a`
3548
text-align: left;
3649
text-decoration: underline;
3750
`
51+
3852
export const NameContainer = styled.div`
3953
color: #1a3185;
4054
font-size: 25px;
@@ -43,18 +57,6 @@ export const NameContainer = styled.div`
4357
letter-spacing: 0em;
4458
text-align: left;
4559
`
46-
export const DescrContainer = styled.div`
47-
font-size: 16px;
48-
font-weight: 500;
49-
line-height: 20px;
50-
letter-spacing: 0.015em;
51-
text-align: left;
52-
`
53-
54-
export const Divider = styled.hr`
55-
border: 1px solid #979797;
56-
margin: 0;
57-
`
5860

5961
export const PageDescr = styled.div`
6062
font-weight: 700;
@@ -65,6 +67,7 @@ export const PageTitle = styled.div`
6567
font-weight: 600;
6668
font-size: 60px;
6769
`
70+
6871
export const SectionContainer = styled.div`
6972
border-radius: 10px;
7073
background: white;
@@ -77,3 +80,9 @@ export const SectionTitle = styled.div`
7780
font-size: 26px;
7881
border-radius: 10px 10px 0 0;
7982
`
83+
84+
const StyledContainer = styled(Container)`
85+
//border-top: 1px solid #979797;
86+
background: white;
87+
border-radius: 0 0 10px 10px;
88+
`

pages/hearings/index.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import { GetStaticProps } from "next"
2-
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
32
import { useTranslation } from "next-i18next"
3+
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
4+
45
import { Container } from "components/bootstrap"
5-
import { HearingSearch } from "components/search"
6-
import { createPage } from "components/page"
76
import { flags } from "components/featureFlags"
7+
import { createPage } from "components/page"
8+
import { HearingSearch } from "components/search"
89

910
const HearingsPage = createPage({
1011
titleI18nKey: "navigation.browseHearings",
1112
Page: () => {
12-
const { t } = useTranslation("search")
13+
const { t } = useTranslation("common")
1314

1415
return (
1516
<Container fluid="md" className="mt-3">
16-
<h1>{t("browse_hearings")}</h1>
17+
<h1>{t("navigation.browseHearings")}</h1>
1718
<HearingSearch />
1819
</Container>
1920
)
@@ -31,10 +32,10 @@ export const getStaticProps: GetStaticProps = async ctx => {
3132
props: {
3233
...(await serverSideTranslations(locale, [
3334
"auth",
34-
"search",
3535
"common",
3636
"footer",
37-
"hearing"
37+
"hearing",
38+
"search"
3839
]))
3940
}
4041
}

public/locales/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"about": "About",
33
"back_to_bills": "back to list of bills",
4+
"back_to_hearings": "back to list of hearings",
45
"bill": {
56
"and_others_one": "and {{count}} other",
67
"and_others_other": "and {{count}} others",

public/locales/en/hearing.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"bills_consideration": "Bills under consideration",
44
"chairs": "Chairs",
55
"committee_members": "Committee members",
6-
"hearing": "Hearing ",
76
"hearing_details": "Hearing details",
87
"house_chair": "House Chair",
98
"member": "Member",
@@ -23,6 +22,7 @@
2322
"see_less": "See less",
2423
"senate_chair": "Senate Chair",
2524
"transcription_not_on_file": "This hearing does not yet have a transcription on file",
25+
"video_and_transcription_feature_callout": "Hearing Video + Transcription",
2626
"view_bill": "View Bill Details",
2727
"view_votes": "View hearing votes",
2828
"votes": "Votes",

public/locales/en/search.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"another_term": "Try another search term",
33
"browse_bills": "Browse Bills",
4-
"browse_hearings": "Browse Hearings",
54
"filter": "Filter",
65
"topics": "Topics",
76
"zero_results": "Your search has yielded zero results!",

0 commit comments

Comments
 (0)