This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor: Update feedback styles #133
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare module '*.svg'; | ||
declare module '*.module.css'; | ||
declare module '*.module.scss'; |
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 |
---|---|---|
@@ -1,49 +1,57 @@ | ||
import React, {useEffect, useState} from "react"; | ||
import React, {useEffect, useState} from 'react'; | ||
import {__} from '@wordpress/i18n'; | ||
import Container from './Container' | ||
import FeedbackButton from "./FeedbackButton"; | ||
import Container from './Container'; | ||
import FeedbackButton from './FeedbackButton'; | ||
|
||
import { | ||
Container as PopupContainer, | ||
Header as PopupHeader, | ||
Content as PopupContent, | ||
} from './popup' | ||
import {Container as PopupContainer, Content as PopupContent, Header as PopupHeader} from './popup'; | ||
import {ExternalLink} from '@wordpress/components'; | ||
|
||
const feedbackUrl = 'https://docs.givewp.com/nextgenfeedback'; | ||
|
||
const HIDE_FEEDBACK = 'givewpNextGenHideFeedback' | ||
const HIDE_FEEDBACK = 'givewpNextGenHideFeedback'; | ||
|
||
const Feedback = () => { | ||
|
||
const [ hidden, setHidden ] = useState(true) | ||
const [hidden, setHidden] = useState(false); | ||
const closeCallback = () => { | ||
setHidden(true) | ||
localStorage.setItem(HIDE_FEEDBACK, 'true') | ||
} | ||
setHidden(true); | ||
localStorage.setItem(HIDE_FEEDBACK, 'true'); | ||
}; | ||
|
||
useEffect(() => { | ||
setHidden(!! localStorage.getItem(HIDE_FEEDBACK)) | ||
}) | ||
setHidden(!!localStorage.getItem(HIDE_FEEDBACK)); | ||
}, []); | ||
|
||
return ( | ||
<Container> | ||
{!hidden && ( | ||
<PopupContainer> | ||
<PopupHeader title={__('Have feedback?', 'give')} closeCallback={closeCallback} /> | ||
<PopupContent> | ||
{__('Let us know what you think about the form builder to help improve the product experience.', 'give')} | ||
{' '} | ||
<a href={feedbackUrl} target="_blank" rel="noopener noreferrer" onClick={closeCallback} style={{color: 'var(--givewp-primary-600)'}}> | ||
{__('Click here', 'give')} | ||
</a> | ||
<div> | ||
<span> | ||
{__( | ||
'Let us know what you think about the form builder to help improve the product experience.', | ||
'give' | ||
)} | ||
</span> | ||
</div> | ||
<div> | ||
<ExternalLink | ||
href={feedbackUrl} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
onClick={closeCallback} | ||
style={{color: 'var(--givewp-primary-600)'}} | ||
> | ||
{__('Provide Feedback', 'give')} | ||
</ExternalLink> | ||
</div> | ||
</PopupContent> | ||
</PopupContainer> | ||
)} | ||
<FeedbackButton href={feedbackUrl} onClick={closeCallback}> | ||
{__('Feedback', 'give')} | ||
</FeedbackButton> | ||
<FeedbackButton onClick={() => setHidden(!hidden)}>{__('Feedback', 'give')}</FeedbackButton> | ||
</Container> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default Feedback; |
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,20 +1,22 @@ | ||
const Container = ({children}) => { | ||
return ( | ||
<div style={{ | ||
position: 'relative', | ||
border: '1px solid var(--givewp-gray-30)', | ||
boxShadow: '0px 2px 4px rgba(221, 221, 221, 0.25)', | ||
borderRadius: '5px', | ||
backgroundColor: 'white', | ||
padding: '24px 16px', | ||
width: '324px', | ||
display: 'flex', | ||
gap: '12px', | ||
flexDirection: 'column', | ||
}}> | ||
<div | ||
style={{ | ||
position: 'relative', | ||
border: '1px solid var(--givewp-gray-30)', | ||
boxShadow: '0px 2px 4px rgba(221, 221, 221, 0.25)', | ||
borderRadius: '5px', | ||
backgroundColor: 'white', | ||
padding: '1rem', | ||
width: '324px', | ||
display: 'flex', | ||
gap: '12px', | ||
flexDirection: 'column', | ||
}} | ||
> | ||
{children} | ||
</div> | ||
) | ||
); | ||
} | ||
|
||
export default Container; |
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,13 +1,18 @@ | ||
const Content = ({children}) => { | ||
return ( | ||
<div style={{ | ||
fontSize: '14px', | ||
fontWeight: 400, | ||
lineHeight: '19.6px', | ||
}}> | ||
<div | ||
style={{ | ||
fontSize: '14px', | ||
fontWeight: 400, | ||
lineHeight: '19.6px', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '1rem', | ||
}} | ||
> | ||
{children} | ||
</div> | ||
) | ||
); | ||
} | ||
|
||
export default Content; |
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,32 +1,32 @@ | ||
import {Button, Icon} from "@wordpress/components"; | ||
import CloseIcon from "./CloseIcon"; | ||
import HeaderIcon from "./HeaderIcon"; | ||
import {Button, Icon} from '@wordpress/components'; | ||
import CloseIcon from './CloseIcon'; | ||
import HeaderIcon from './HeaderIcon'; | ||
|
||
const Header = ({title, closeCallback}) => { | ||
return ( | ||
<header style={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
}}> | ||
<div style={{ | ||
<header | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
gap: '10px', | ||
fontSize: '16px', | ||
fontWeight: 500, | ||
lineHeight: '16px', | ||
}}> | ||
}} | ||
> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: '10px', | ||
fontSize: '16px', | ||
fontWeight: 500, | ||
lineHeight: '16px', | ||
}} | ||
> | ||
<Icon icon={HeaderIcon} /> | ||
{title} | ||
</div> | ||
<Button | ||
style={{padding: 0, height: 'auto'}} | ||
icon={CloseIcon} | ||
onClick={closeCallback} | ||
/> | ||
<Button style={{padding: 0, height: 'auto'}} icon={CloseIcon} onClick={closeCallback} /> | ||
</header> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default Header; |
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.
I tried to import this as an svg file and assign to an img src but it kept making a relative url as the src instead of an inline data src. This works fine in the next gen app but not here. Must be a webpack config thing since we're using laravel mix here. Should figure that out at some point for the future when using images / local icons.