-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: separates
pCashSignupDetails
in context
- creates new property `pCashSignupDetails` in context - removes type `PlanetCashSignupDetails` from projectDetails in context - uses`pCashSignupDetails` to display `PlanetCashSignup` (Donations/index) - refactors LeftPanel & child components to use `pCashSignupDetails` - renames `projectDetails` arg to `getTenantBackground` for clarity
- Loading branch information
1 parent
46c5570
commit 9d546e5
Showing
11 changed files
with
113 additions
and
91 deletions.
There are no files selected for viewing
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 was deleted.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { ReactElement } from "react"; | ||
import { | ||
FetchedProjectDetails, | ||
PlanetCashSignupDetails, | ||
} from "src/Common/Types"; | ||
import VerifiedBadge from "./VerifiedBadge"; | ||
import styles from "./LeftPanel.module.scss"; | ||
|
||
interface Props { | ||
info: FetchedProjectDetails | PlanetCashSignupDetails; | ||
} | ||
|
||
const ProjectTitle = ({ info }: Props): ReactElement => { | ||
const isLinked = info.purpose === "trees" || info.purpose === "conservation"; | ||
|
||
return ( | ||
<h1 className={`${styles["project-title"]} title-text`}> | ||
{isLinked ? ( | ||
<a | ||
rel="noreferrer" | ||
target="_blank" | ||
href={`https://www.trilliontreecampaign.org/${info.id}`} | ||
> | ||
{info.name + " "} | ||
</a> | ||
) : ( | ||
<>{info.name + " "}</> | ||
)} | ||
{info.purpose !== "planet-cash-signup" && | ||
info.name !== null && | ||
info.isApproved && <VerifiedBadge />} | ||
</h1> | ||
); | ||
}; | ||
|
||
export default ProjectTitle; |
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
Oops, something went wrong.