-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OMN-189] : Settings View - Emails #286
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1f51710
[OMN-189] : Settings View - Emails
gitstart 2593596
Merge commit '42e2beb53d89b333611f215e63d366034905bba6' into OMN-189
gitstart 8fbb976
Effected review corrections
gitstart a56314c
updated full url to relative url for learn more link
gitstart f92c4a3
Remove uneeded coma
jacksonh 1ff66da
Merge commit '6e36bb271f595d6dfe02ddee320980d433917d35' into OMN-189
gitstart 77b97c4
fix borderRadius for single email
gitstart f76abe0
Merge commit '54e4c04c31457c6d320be50fc65180deb2b75f98' into OMN-189
gitstart 46b2dc1
remove unneeded change
gitstart File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React, { FC } from 'react'; | ||
import { styled, keyframes } from '@stitches/react'; | ||
import * as TooltipPrimitive from '@radix-ui/react-tooltip'; | ||
|
||
const slideUpAndFade = keyframes({ | ||
'0%': { opacity: 0, transform: 'translateY(2px)' }, | ||
'100%': { opacity: 1, transform: 'translateY(0)' }, | ||
}); | ||
|
||
const slideRightAndFade = keyframes({ | ||
'0%': { opacity: 0, transform: 'translateX(-2px)' }, | ||
'100%': { opacity: 1, transform: 'translateX(0)' }, | ||
}); | ||
|
||
const slideDownAndFade = keyframes({ | ||
'0%': { opacity: 0, transform: 'translateY(-2px)' }, | ||
'100%': { opacity: 1, transform: 'translateY(0)' }, | ||
}); | ||
|
||
const slideLeftAndFade = keyframes({ | ||
'0%': { opacity: 0, transform: 'translateX(2px)' }, | ||
'100%': { opacity: 1, transform: 'translateX(0)' }, | ||
}); | ||
|
||
const StyledContent = styled(TooltipPrimitive.Content, { | ||
borderRadius: 4, | ||
padding: '8px 13px', | ||
fontSize: 12, | ||
color: '#FFFFFF', | ||
backgroundColor: '#1C1C1E', | ||
'@media (prefers-reduced-motion: no-preference)': { | ||
animationDuration: '400ms', | ||
animationTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)', | ||
animationFillMode: 'forwards', | ||
willChange: 'transform, opacity', | ||
'&[data-state="delayed-open"]': { | ||
'&[data-side="top"]': { animationName: slideDownAndFade }, | ||
'&[data-side="right"]': { animationName: slideLeftAndFade }, | ||
'&[data-side="bottom"]': { animationName: slideUpAndFade }, | ||
'&[data-side="left"]': { animationName: slideRightAndFade }, | ||
}, | ||
}, | ||
}); | ||
|
||
const StyledArrow = styled(TooltipPrimitive.Arrow, { | ||
fill: '#1C1C1E', | ||
}); | ||
|
||
export const TooltipProvider = TooltipPrimitive.Provider; | ||
export const Tooltip = TooltipPrimitive.Root; | ||
export const TooltipTrigger = TooltipPrimitive.Trigger; | ||
export const TooltipContent = StyledContent; | ||
export const TooltipArrow = StyledArrow; | ||
|
||
|
||
type TooltipWrappedProps = { | ||
tooltipContent: string, | ||
tooltipSide ?: TooltipPrimitive.TooltipContentProps['side'], | ||
align?: TooltipPrimitive.TooltipContentProps['align'], | ||
alignOffset?: TooltipPrimitive.TooltipContentProps['alignOffset'] | ||
arrowStyles?: TooltipPrimitive.TooltipArrowProps['style'] | ||
style?: TooltipPrimitive.TooltipContentProps['style'] | ||
} | ||
|
||
export const TooltipWrapped: FC<TooltipWrappedProps> = ({children, tooltipContent, tooltipSide, ...props}) => { | ||
return ( | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
{children} | ||
</TooltipTrigger> | ||
<TooltipContent sideOffset={5} side={tooltipSide} {...props} > | ||
{tooltipContent} | ||
<TooltipArrow style={props.arrowStyles} /> | ||
</TooltipContent> | ||
</Tooltip> | ||
) | ||
} |
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
31 changes: 31 additions & 0 deletions
31
packages/web/lib/networking/mutations/deleteNewsletterEmailMutation.ts
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,31 @@ | ||
import { gql } from 'graphql-request' | ||
import { gqlFetcher } from '../networkHelpers' | ||
|
||
export async function deleteNewsletterEmailMutation( | ||
newsletterEmailId: string | ||
): Promise<string | undefined> { | ||
const mutation = gql` | ||
mutation DeleteNewsletterEmailMutation($newsletterEmailId: ID!) { | ||
deleteNewsletterEmail(newsletterEmailId: $newsletterEmailId) { | ||
... on DeleteNewsletterEmailSuccess { | ||
newsletterEmail { | ||
id | ||
address | ||
} | ||
} | ||
... on DeleteNewsletterEmailError { | ||
errorCodes | ||
} | ||
} | ||
} | ||
` | ||
|
||
try { | ||
const data = await gqlFetcher(mutation, { newsletterEmailId }) | ||
console.log('delete email', data) | ||
return 'data' | ||
} catch (error) { | ||
console.log('deleteNewsletterEmailMutation error', error) | ||
return undefined | ||
} | ||
} |
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 |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
"@radix-ui/react-id": "^0.1.1", | ||
"@radix-ui/react-popover": "^0.1.1", | ||
"@radix-ui/react-separator": "^0.1.0", | ||
"@radix-ui/react-tooltip": "^0.1.7", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
"@segment/analytics-next": "^1.33.5", | ||
"@sentry/nextjs": "^6.16.1", | ||
"@stitches/react": "^1.2.5", | ||
|
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ import { useRouter } from 'next/router' | |
import { useEffect, useState } from 'react' | ||
import { Analytics, AnalyticsBrowser } from '@segment/analytics-next' | ||
import { segmentApiKey } from '../lib/appConfig' | ||
import { TooltipProvider } from '../components/elements/Tooltip' | ||
|
||
function OmnivoreApp({ Component, pageProps }: AppProps): JSX.Element { | ||
const router = useRouter() | ||
|
@@ -48,7 +49,9 @@ function OmnivoreApp({ Component, pageProps }: AppProps): JSX.Element { | |
defaultLocale="en" | ||
messages={englishTranslations} | ||
> | ||
<Component {...pageProps} /> | ||
<TooltipProvider delayDuration={200}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah this is handy. Should be able to use these a lot more now. |
||
<Component {...pageProps} /> | ||
</TooltipProvider> | ||
</IntlProvider> | ||
</IdProvider> | ||
) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍