Skip to content
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

feat: Feedback dialog #772

Merged
merged 31 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f4b4f6e
feat: initial commit and experience selector
vpicone Mar 9, 2020
3e7cba1
feat: add data submission
vpicone Mar 9, 2020
fa0a846
feat: add text fadeout
vpicone Mar 9, 2020
2078af4
fix: thicken outline when focused
vpicone Mar 9, 2020
b85ef59
feat: better focus handling
vpicone Mar 9, 2020
02b63c0
fix: focus stealing
vpicone Mar 9, 2020
6ab141c
fix: button text alignment, fieldset spacing, pointer events
vpicone Mar 10, 2020
47df804
fix: focus and style tweaks, use Carbon textbox
vpicone Mar 10, 2020
4371453
feat: add entrance animation
vpicone Mar 11, 2020
62002f2
feat: fade on scroll
vpicone Mar 11, 2020
6efec09
Merge branch 'master' into feedback-dialog
vpicone Mar 11, 2020
34aa206
fix: animation choreography
vpicone Mar 11, 2020
2ba30be
Merge branch 'feedback-dialog' of github.com:vpicone/gatsby-theme-car…
vpicone Mar 11, 2020
68458ef
feat: add livve url
vpicone Mar 12, 2020
950c3ac
fix: safari zamboni and text zoom
vpicone Mar 12, 2020
b86ac5e
fix: safari zamboni and resize
vpicone Mar 12, 2020
7858fe7
fix: animation performance
vpicone Mar 12, 2020
c712134
docs: add Feedback docs
vpicone Mar 12, 2020
230deb5
fix: homepage rendering and console errors
vpicone Mar 12, 2020
10e523a
fix: desktop transition speed
vpicone Mar 12, 2020
e8de24a
fix: focus return and icon flexibility
vpicone Mar 13, 2020
ecdaa7d
cchore: remove unused dep
vpicone Mar 13, 2020
19d0c2a
fix: list overflow weirdness
vpicone Mar 14, 2020
6273273
feat: add submission indicators and mobile styles
vpicone Mar 14, 2020
a408fd7
chore: checkmark tweaks
vpicone Mar 14, 2020
fe18144
fix: launch button active and hover styles
vpicone Mar 14, 2020
44a2c5c
fix: use proper focus token
vpicone Mar 14, 2020
a8f11ab
fix: icon visibility animation
vpicone Mar 14, 2020
d2b7602
fix: slow down stroke, add thanks and adjust reset
vpicone Mar 16, 2020
6c9f847
fix: add background hover change
vpicone Mar 16, 2020
0819436
fix: inverse 01
vpicone Mar 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add livve url
  • Loading branch information
vpicone committed Mar 12, 2020
commit 68458efb6fbeacf0adc963335ddba783de13a7f6
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const FeedbackDialog = () => {
/>
<LaunchButton
ref={launchButtonRef}
visible={visible}
onClick={() => setVisible(!visible)}
/>
</>
Expand Down
26 changes: 12 additions & 14 deletions packages/gatsby-theme-carbon/src/components/FeedbackDialog/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,20 @@ const Form = ({ visible, setVisible, launchButtonRef }) => {

const onSubmit = () => {
const form = new FormData(formRef.current);
// const data = {
// experience: form.get('feedback-form-experience'),
// comment: form.get('feedback-form-comment'),
// path: window.location.href,
// };
const data = {
experience: form.get('feedback-form-experience'),
comment: form.get('feedback-form-comment'),
path: window.location.href,
};

// fetch('http://localhost:34567/.netlify/functions/survey', {
// method: 'POST',
// body: JSON.stringify(data),
// });
fetch('https://carbon-website.netlify.com/.netlify/functions/survey', {
method: 'POST',
mode: 'no-cors',
credentials: 'include',
body: JSON.stringify(data),
});

alert(`
experience: ${form.get('feedback-form-experience')}
comment: ${form.get('feedback-form-comment')}
path: ${window.location.href}
`);
setVisible(false);
};

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
import React from 'react';
import { ChatBot20 } from '@carbon/icons-react';
import React, { useState } from 'react';
import { FaceWink20, FaceWinkFilled20 } from '@carbon/icons-react';
import styles from './LaunchButton.module.scss';

const LaunchButton = React.forwardRef(function LaunchButton({ onClick }, ref) {
const LaunchButton = React.forwardRef(function LaunchButton(
{ onClick, visible },
ref
) {
const [hovering, setHovering] = useState(false);

// TODO: hover && visible for both background change and inversion effects?
// action on submit?
return (
<button
onMouseEnter={() => setHovering(true)}
onMouseLeave={() => setHovering(false)}
ref={ref}
type="button"
aria-haspopup
className={styles.button}
onClick={onClick}
aria-label="This launches a modal form to give website feedback."
>
<ChatBot20 />
{hovering ? <FaceWinkFilled20 /> : <FaceWink20 />}
</button>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
height: $spacing-09;
border-radius: 50%;
border-color: transparent;
background: var(--cds-ui-background);
background: var(--cds-ui-03);
transition: all $transition--base;

cursor: pointer;
Expand All @@ -12,7 +12,7 @@
}

.button:hover {
background: #4c4c4c; // g90 hover ui
background: var(--cds-active-01); // g90 hover ui
border-color: transparent;
}

Expand Down