Skip to content

Commit

Permalink
fix: use an icon button
Browse files Browse the repository at this point in the history
  • Loading branch information
DanWebb committed Feb 8, 2024
1 parent 5b00e54 commit 2fc2f83
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions src/FeedbackButton.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
import markerSDK from '@marker.io/browser';
import { Button } from '@storybook/components';
import { Icons, IconButton } from '@storybook/components';
import { useParameter } from '@storybook/manager-api';
import { styled } from '@storybook/theming';
import React, { useCallback, useEffect, useState } from 'react';

import { TOOL_ID } from './constants';

const IconButtonWithLabel = styled(IconButton)(() => ({
display: 'inline-flex',
alignItems: 'center',
}));

const IconButtonLabel = styled.div(({ theme }) => ({
display: 'inline-block',
textDecoration: 'none',
padding: '10px 5px',
fontWeight: theme.typography.weight.bold,
fontSize: theme.typography.size.s2 - 1,
lineHeight: '1',
height: 37,
border: 'none',
borderTop: '3px solid transparent',
borderBottom: '3px solid transparent',
background: 'transparent',
}));

const hideDefaultMarkerButton = () => {
const markerBtns = [
...document.querySelectorAll('.marker-app #feedback-button'),
Expand Down Expand Up @@ -37,18 +57,9 @@ export default function FeedbackButton() {
}, [mode]);

return markerLoaded ? (
<Button
style={{
height: '28px',
marginBlockStart: '6px',
marginInlineStart: '4px',
}}
key={TOOL_ID}
onClick={handleSendFeedback}
outline
small
>
Feedback
</Button>
<IconButtonWithLabel key={TOOL_ID} onClick={handleSendFeedback}>
<Icons icon="comment" />
<IconButtonLabel>Feedback</IconButtonLabel>
</IconButtonWithLabel>
) : null;
}

0 comments on commit 2fc2f83

Please sign in to comment.