Skip to content

Commit

Permalink
Merge branch 'main' into fw-3776-matomo
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahfirstvoices authored Oct 24, 2023
2 parents 4e0989e + eed573e commit 25b3534
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
6 changes: 5 additions & 1 deletion src/components/Dashboard/DashboardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ function DashboardContainer() {
const { currentUser, site, homeTiles, isLoading, logout } = DashboardData()
return (
<Loading.Container isLoading={isLoading}>
<DashboardPresentation currentUser={currentUser} site={site}>
<DashboardPresentation
currentUser={currentUser}
site={site}
logout={logout}
>
<Routes>
<Route
path="profile"
Expand Down
28 changes: 24 additions & 4 deletions src/components/Dashboard/DashboardPresentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,28 @@ import getIcon from 'common/utils/getIcon'
import RequireAuth from 'common/RequireAuth'
import { ASSISTANT, MEMBER, EDITOR } from 'common/constants/roles'

function DashboardPresentation({ children, currentUser, site }) {
function DashboardPresentation({ children, currentUser, site, logout }) {
const logoutButton = (
<div className="flex content-end p-2 text-sm font-medium text-gray-300 hover:bg-fv-charcoal-light hover:text-white">
<button
type="button"
onClick={logout}
className="space-y-1 flex w-full block py-4 px-2 "
>
{getIcon(
'LogOut',
'text-gray-400 fill-current group-hover:text-gray-300 mr-4 flex-shrink-0 h-6 w-6',
)}
<span>SIGN OUT</span>
</button>
</div>
)

return (
<div data-testid="DashboardPresentation">
{/* Sidebar */}
<div className="flex w-64 flex-col fixed inset-y-0">
<div className="flex-1 flex flex-col min-h-0 bg-fv-charcoal">
<div className="flex-1 flex flex-col min-h-0 bg-fv-charcoal divide-y divide-fv-charcoal-light space-y-2">
<div className="flex-1 flex flex-col pt-5 pb-4 overflow-y-auto">
<div className="flex items-center flex-shrink-0 px-4 mb-5">
{getIcon('FVLogo', 'fill-current text-white h-8 w-auto')}
Expand All @@ -30,7 +46,10 @@ function DashboardPresentation({ children, currentUser, site }) {
</div>
</nav>
</div>
{userProfile(currentUser)}
<div>
{logoutButton}
{userProfile(currentUser)}
</div>
</div>
</div>
<div className="bg-gray-200 pl-64 flex flex-col min-h-screen">
Expand Down Expand Up @@ -160,11 +179,12 @@ const userProfile = (user) => (
)

// PROPTYPES
const { node, object } = PropTypes
const { node, object, func } = PropTypes
DashboardPresentation.propTypes = {
children: node,
currentUser: object,
site: object,
logout: func,
}

export default DashboardPresentation
7 changes: 3 additions & 4 deletions src/components/DashboardHome/DashboardHomePresentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'
import DashboardTiles from 'components/DashboardTiles'
import DashboardLocator from 'components/DashboardLocator'

function DashboardHomePresentation({ site, tiles, currentUser, logout }) {
function DashboardHomePresentation({ site, tiles, currentUser }) {
return (
<main id="DashboardHome">
<div className="mx-auto p-4 sm:p-6 lg:p-8">
Expand Down Expand Up @@ -36,7 +36,7 @@ function DashboardHomePresentation({ site, tiles, currentUser, logout }) {
</p>
</div>
</div>
<DashboardLocator.Presentation site={site} logout={logout} />
<DashboardLocator.Presentation site={site} />
</div>
</div>
</div>
Expand All @@ -47,12 +47,11 @@ function DashboardHomePresentation({ site, tiles, currentUser, logout }) {
)
}
// PROPTYPES
const { array, object, func } = PropTypes
const { array, object } = PropTypes
DashboardHomePresentation.propTypes = {
currentUser: object,
site: object,
tiles: array,
logout: func,
}

export default DashboardHomePresentation
16 changes: 2 additions & 14 deletions src/components/DashboardLocator/DashboardLocatorPresentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ import PropTypes from 'prop-types'

// FPCC

function DashboardLocatorPresentation({ site, logout }) {
const logoutButton = (
<button
type="button"
onClick={logout}
className="mt-5 bg-secondary border border-transparent rounded-lg shadow-sm py-2 px-4 inline-flex justify-center text-sm font-medium text-white hover:bg-secondary-light focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary-light"
>
LOGOUT
</button>
)
function DashboardLocatorPresentation({ site }) {
return (
<div id="DashboardLocator" className="flex items-center space-x-5">
<div className="pt-1 text-right">
Expand All @@ -29,25 +20,22 @@ function DashboardLocatorPresentation({ site, logout }) {
src={site?.logoPathSmall}
alt={`${site?.title} Logo`}
/>
{logoutButton}
</div>
) : (
<div>
<div className="flex max-w-xs p-3 bg-secondary hover:bg-secondary-dark text-white text-3xl rounded-full h-20 w-20 items-center justify-center">
<span className="text-center">{site?.title?.charAt(0)}</span>
</div>
{logoutButton}
</div>
)}
</div>
</div>
)
}
// PROPTYPES
const { object, func } = PropTypes
const { object } = PropTypes
DashboardLocatorPresentation.propTypes = {
site: object,
logout: func,
}

export default DashboardLocatorPresentation
3 changes: 3 additions & 0 deletions src/components/LandingPage/LandingPageData.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {

function LandingPageData() {
const whyData = {
id: 1,
type: WIDGET_TEXTICONS,
settings: {
mockData: true,
Expand All @@ -22,6 +23,7 @@ function LandingPageData() {
}

const aboutData = {
id: 2,
type: WIDGET_TEXT,
settings: {
mockData: true,
Expand All @@ -37,6 +39,7 @@ function LandingPageData() {
}

const quotesData = {
id: 3,
type: WIDGET_QUOTES,
settings: {
quote1:
Expand Down

0 comments on commit 25b3534

Please sign in to comment.