-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #917 from eisbuk/feature/single-account-multiple-a…
…thletes Feature/single account multiple athletes
- Loading branch information
Showing
51 changed files
with
1,427 additions
and
669 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. | ||
{ | ||
"pnpmShrinkwrapHash": "c8781aa0eecdca84acfe762ce15c915e5bf08828", | ||
"pnpmShrinkwrapHash": "fad0f80cd56291c19d54901d4bb76389a9449c1a", | ||
"preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from "react"; | ||
import { useSelector } from "react-redux"; | ||
import { Link } from "react-router-dom"; | ||
|
||
import { | ||
useFirestoreSubscribe, | ||
useUpdateSubscription, | ||
} from "@eisbuk/react-redux-firebase-firestore"; | ||
import { OrgSubCollection } from "@eisbuk/shared"; | ||
import { Routes } from "@eisbuk/shared/ui"; | ||
import { LayoutContent } from "@eisbuk/ui"; | ||
|
||
import Layout from "@/controllers/Layout"; | ||
|
||
import ErrorBoundary from "@/components/atoms/ErrorBoundary"; | ||
|
||
import { getOrganization } from "@/lib/getters"; | ||
|
||
import { getAllSecretKeys } from "@/store/selectors/auth"; | ||
import { getOtherBookingsAccounts } from "@/store/selectors/bookings"; | ||
|
||
const SelectAccount: React.FC = () => { | ||
const secretKeys = useSelector(getAllSecretKeys) || []; | ||
const accounts = useSelector(getOtherBookingsAccounts("")); | ||
|
||
// Subscribe to necessary collections | ||
useFirestoreSubscribe(getOrganization(), [ | ||
{ | ||
collection: OrgSubCollection.Bookings, | ||
meta: { secretKeys }, | ||
}, | ||
]); | ||
|
||
useUpdateSubscription( | ||
{ collection: OrgSubCollection.Bookings, meta: { secretKeys } }, | ||
[secretKeys] | ||
); | ||
|
||
return ( | ||
<Layout> | ||
<LayoutContent> | ||
<ErrorBoundary resetKeys={[]}> | ||
<div className="px-[44px] py-4"> | ||
<h1 className="mt-20 text-2xl font-normal leading-none text-gray-700 cursor-normal select-none mb-12"> | ||
Select account | ||
</h1> | ||
<div className="w-full grid grid-cols-12 gap-5 "> | ||
{accounts?.map((account) => ( | ||
<Link | ||
className="rounded border border-gray-300 py-4 px-8 col-span-3 hover:bg-gray-50 hover:border-gray-700" | ||
to={`${Routes.CustomerArea}/${account.secretKey}`} | ||
> | ||
<span className="text-lg text-gray-700">{account.name}</span> | ||
<br /> | ||
<span className="text-lg text-gray-700"> | ||
{account.surname} | ||
</span> | ||
</Link> | ||
))} | ||
</div> | ||
</div> | ||
</ErrorBoundary> | ||
</LayoutContent> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default SelectAccount; |
Oops, something went wrong.