Skip to content

Commit

Permalink
repositioned newsfeed buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
mertbagt committed Jan 13, 2025
1 parent 4b87c06 commit 7420faa
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
38 changes: 22 additions & 16 deletions components/Newsfeed/Newsfeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function Newsfeed() {
fetchNotifications()
}, [uid])

function Filters() {
function Filters({ profile }: { profile: Profile }) {
return (
<FilterBoxes
onOrgFilterChange={(isShowing: boolean) => {
Expand All @@ -78,27 +78,30 @@ export default function Newsfeed() {
}}
isShowingOrgs={isShowingOrgs}
isShowingBills={isShowingBills}
profile={profile}
/>
)
}

function FilterBoxes({
onOrgFilterChange,
onBillFilterChange,
isShowingBills,
isShowingOrgs,
isShowingBills
onBillFilterChange,
onOrgFilterChange,
profile
}: {
onOrgFilterChange: any
onBillFilterChange: any
isShowingOrgs: boolean
isShowingBills: boolean
isShowingOrgs: boolean
onBillFilterChange: any
onOrgFilterChange: any
profile: Profile
}) {
const { t } = useTranslation("common")

return (
<>
<Row className={`d-flex ms-5 mt-2 ps-4`} xs="auto">
<Col className="form-check checkbox">
<Col className="form-check checkbox mt-3">
<input
className="form-check-input"
type="checkbox"
Expand All @@ -113,7 +116,7 @@ export default function Newsfeed() {
{t("user_updates")}
</label>
</Col>
<BillCol className="form-check checkbox">
<BillCol className="form-check checkbox mt-3">
<input
className="form-check-input"
type="checkbox"
Expand All @@ -128,6 +131,7 @@ export default function Newsfeed() {
{t("bill_updates")}
</label>
</BillCol>
<Buttons profile={profile} />
</Row>
</>
)
Expand Down Expand Up @@ -161,10 +165,13 @@ export default function Newsfeed() {

return (
<>
<ProfileButtons
isUser={isUser}
onSettingsModalOpen={onSettingsModalOpen}
/>
<div>
<ProfileButtons
isUser={isUser}
hideTestimonyButton={true}
onSettingsModalOpen={onSettingsModalOpen}
/>
</div>
<ProfileSettingsModal
actions={actions}
role={profile.role}
Expand Down Expand Up @@ -197,11 +204,10 @@ export default function Newsfeed() {
<div className={`d-flex align-self-center`}>
<StyledContainer>
<Header>
<HeaderTitle className={`mb-5`}>
<HeaderTitle className={`mb-4`}>
{t("navigation.newsfeed")}
</HeaderTitle>
<Filters />
<Buttons profile={profile} />
<Filters profile={profile} />
</Header>
{filteredResults.length > 0 ? (
<>
Expand Down
26 changes: 16 additions & 10 deletions components/ProfilePage/ProfileButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ export const EditProfileButton = ({
}

export function ProfileButtons({
onSettingsModalOpen,
isUser
isUser,
hideTestimonyButton,
onSettingsModalOpen
}: {
onSettingsModalOpen: () => void
isUser: boolean
hideTestimonyButton: boolean
onSettingsModalOpen: () => void
}) {
const { t } = useTranslation("editProfile")

Expand All @@ -89,13 +91,17 @@ export function ProfileButtons({
}}
tab={"button.followedContent"}
/>
<EditProfileButton
className={`py-1`}
handleClick={() => {
setTabStatus("Testimonies")
}}
tab={"button.yourTestimonies"}
/>
{hideTestimonyButton ? (
<></>
) : (
<EditProfileButton
className={`py-1`}
handleClick={() => {
setTabStatus("Testimonies")
}}
tab={"button.yourTestimonies"}
/>
)}
<OutlineButton
className={`py-1`}
label={t("settings")}
Expand Down

0 comments on commit 7420faa

Please sign in to comment.