-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a2b5d5
commit c4f6260
Showing
13 changed files
with
192 additions
and
52 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 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,50 @@ | ||
import { BrowserClient, Feedback, getCurrentHub } from '@sentry/react'; | ||
import { Flex } from 'leather-styles/jsx'; | ||
|
||
import { analytics } from '@shared/utils/analytics'; | ||
|
||
import { useThemeSwitcher } from '@app/common/theme-provider'; | ||
import { LeatherButton } from '@app/ui/components/button'; | ||
import { MegaphoneIcon } from '@app/ui/components/icons/megaphone-icon'; | ||
|
||
export function openFeedbackDialog() { | ||
void analytics.track('user_clicked_feedback_button'); | ||
const client = getCurrentHub().getClient<BrowserClient>(); | ||
const feedback = client?.getIntegration(Feedback); | ||
if (!feedback) return; | ||
feedback.openDialog(); | ||
} | ||
|
||
export function FeedbackButton() { | ||
const { theme } = useThemeSwitcher(); | ||
return ( | ||
<LeatherButton | ||
background="brown.1" | ||
_hover={{ background: 'brown.2' }} | ||
variant="ghost" | ||
size="sm" | ||
pos="fixed" | ||
bottom="space.04" | ||
right="space.04" | ||
left="auto" | ||
top="auto" | ||
boxShadow={ | ||
theme === 'light' | ||
? '0px 12px 24px 0px rgba(18, 16, 15, 0.08), 0px 4px 8px 0px rgba(18, 16, 15, 0.08), 0px 0px 2px 0px rgba(18, 16, 15, 0.08);' | ||
: undefined | ||
} | ||
filter={ | ||
theme === 'dark' | ||
? 'drop-shadow(0px 12px 24px rgba(247, 245, 243, 0.08)) drop-shadow(0px 4px 8px rgba(247, 245, 243, 0.08)) drop-shadow(0px 0px 2px rgba(247, 245, 243, 0.50));' | ||
: undefined | ||
} | ||
zIndex={9} | ||
onClick={openFeedbackDialog} | ||
> | ||
<Flex> | ||
<MegaphoneIcon mr="space.01" mt="2px" /> | ||
Give feedback | ||
</Flex> | ||
</LeatherButton> | ||
); | ||
} |
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,23 @@ | ||
import { styled } from 'leather-styles/jsx'; | ||
|
||
import { SvgProps } from '@app/ui/ui-types'; | ||
|
||
export function MegaphoneIcon({ size = 'sm', ...props }: SvgProps) { | ||
return ( | ||
<styled.svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width={size} | ||
height={size} | ||
viewBox="0 0 16 16" | ||
fill="none" | ||
{...props} | ||
> | ||
<path | ||
d="M12.1652 9.33339C13.2698 9.33339 14.1652 8.43796 14.1652 7.33339C14.1652 6.22882 13.2698 5.33339 12.1652 5.33339M8.38477 12.1667C8.11021 12.9435 7.36939 13.5001 6.49858 13.5001C5.39401 13.5001 4.49858 12.6046 4.49858 11.5001V10.5001M4.50004 4.16672V10.5001M12.1652 2.73695V11.9298C12.1652 12.3786 11.7307 12.6992 11.3019 12.5668L2.3019 9.78803C2.02248 9.70175 1.83191 9.44346 1.83191 9.15103L1.83191 5.51575C1.83191 5.22332 2.02248 4.96502 2.3019 4.87875L11.3019 2.09995C11.7307 1.96755 12.1652 2.28814 12.1652 2.73695Z" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeWidth="1.5" | ||
/> | ||
</styled.svg> | ||
); | ||
} |
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.