-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add survey card, remove contribution card, update popular tag (#388)
* add survey card * update with new design * remove padding-bottom
- Loading branch information
Showing
8 changed files
with
167 additions
and
183 deletions.
There are no files selected for viewing
125 changes: 0 additions & 125 deletions
125
website/src/components/gallery/ShowcaseContributionCard/index.tsx
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
website/src/components/gallery/ShowcaseContributionCard/styles.module.css
This file was deleted.
Oops, something went wrong.
87 changes: 87 additions & 0 deletions
87
website/src/components/gallery/ShowcaseSurveyCard/index.tsx
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,87 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
import React from "react"; | ||
import styles from "./styles.module.css"; | ||
import useBaseUrl from "@docusaurus/useBaseUrl"; | ||
import { | ||
Card, | ||
CardFooter, | ||
Button, | ||
ToggleButton, | ||
Image, | ||
Body2, | ||
Subtitle1, | ||
} from "@fluentui/react-components"; | ||
|
||
function closeCard(parentDiv) { | ||
let parent = document.getElementById(parentDiv); | ||
parent.style.display = "none"; | ||
// access localStorage until window is defined | ||
if (typeof window !== "undefined") { | ||
localStorage.setItem("surveyCardDisplay", parent.style.display); | ||
} | ||
} | ||
|
||
export default function ShowcaseSurveyCard(): React.ReactElement { | ||
// access localStorage until window is defined | ||
if ( | ||
typeof window !== "undefined" && | ||
localStorage.getItem("surveyCardDisplay") | ||
) { | ||
return null; | ||
} | ||
return ( | ||
<Card className={styles.card} appearance="filled" id="surveyCard"> | ||
<ToggleButton | ||
onClick={() => closeCard("surveyCard")} | ||
size="small" | ||
appearance="transparent" | ||
icon={ | ||
<Image | ||
src={useBaseUrl("/img/close.svg")} | ||
height={16} | ||
width={16} | ||
alt="Close" | ||
/> | ||
} | ||
className={styles.closeButton} | ||
/> | ||
<Image | ||
src={useBaseUrl("/img/chatPencil.svg")} | ||
alt="surveyCard" | ||
height={128} | ||
width={128} | ||
/> | ||
<div className={styles.text}> | ||
<Subtitle1 align="center">Got a minute? We're all ears!</Subtitle1> | ||
<Body2 align="center"> | ||
Help us shape the future of our template library by sharing your | ||
feedback. | ||
</Body2> | ||
</div> | ||
<CardFooter> | ||
<Button | ||
appearance="primary" | ||
size="large" | ||
className={styles.surveyButton} | ||
onClick={() => { | ||
window.open("https://aka.ms/awesome-azd-survey", "_blank"); | ||
}} | ||
icon={ | ||
<Image | ||
src={useBaseUrl("/img/openLink.svg")} | ||
alt="surveyCard" | ||
height={20} | ||
width={20} | ||
/> | ||
} | ||
> | ||
Take the survey | ||
</Button> | ||
</CardFooter> | ||
</Card> | ||
); | ||
} |
37 changes: 37 additions & 0 deletions
37
website/src/components/gallery/ShowcaseSurveyCard/styles.module.css
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,37 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
/* Keep for future change on light vs dark theme */ | ||
|
||
.card { | ||
width: 350px; | ||
height: 368px; | ||
max-width: 100%; | ||
border-radius: 8px; | ||
max-height: 100%; | ||
min-width: 300px; | ||
padding: 20px !important; | ||
align-items: center; | ||
} | ||
|
||
.text { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.surveyButton{ | ||
background-color: #7160e8 !important; | ||
} | ||
|
||
.surveyButton:hover { | ||
background-color: #5a4cb9 !important; | ||
} | ||
|
||
.closeButton { | ||
position: absolute; | ||
right: 20px; | ||
top: 20px; | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.