forked from Uniswap/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add navigation * feat: add footer * fix: update types * fix: attempt to fix font issue * fix: coderabbit comments * styling breadcrumbs and toc * stylize breadcrumb sidenav prev next links and rebase * add sentiment track block * add icons * rebase * suppress prop type for swizzled files * add aria label and remove unnecessary files * refactor and add gif to prettier ignore * remove unnecessary swizzled files * fix preview * remove files * remove files * add wrapper to toc --------- Co-authored-by: Sohee Lim <[email protected]>
- Loading branch information
1 parent
59d45bb
commit ba6864f
Showing
22 changed files
with
471 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
**/.hg | ||
*.mdx | ||
*.md | ||
*.hbs | ||
*.hbs | ||
*.gif |
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,8 @@ | ||
/** @type {import('postcss').PostcssConfig} */ | ||
module.exports = { | ||
plugins: { | ||
'postcss-import': {}, | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
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,42 @@ | ||
import React from 'react' | ||
import { Sentiment } from '.' | ||
import { TraceEvent } from '@uniswap/analytics' | ||
import { BrowserEvent, DocsSentiment, DocsSentimentSection, SharedEventName } from '@uniswap/analytics-events' | ||
import cn from 'classnames' | ||
|
||
interface SentimentButtonProps { | ||
sentiment: Sentiment | ||
icon: React.ReactNode | ||
selected: boolean | ||
onSelect: (sentiment: Sentiment) => void | ||
analyticsSection: DocsSentimentSection | ||
} | ||
|
||
const SentimentButton: React.FC<SentimentButtonProps> = ({ sentiment, icon, selected, onSelect, analyticsSection }) => { | ||
const sentimentMap: Record<Sentiment, DocsSentiment> = { | ||
[Sentiment.POSITIVE]: DocsSentiment.POSITIVE_SENTIMENT, | ||
[Sentiment.NEUTRAL]: DocsSentiment.NEUTRAL_SENTIMENT, | ||
[Sentiment.NEGATIVE]: DocsSentiment.NEGATIVE_SENTIMENT, | ||
} | ||
|
||
const handleClick = () => onSelect(sentiment) | ||
|
||
return ( | ||
<TraceEvent | ||
element={sentimentMap[sentiment]} | ||
name={SharedEventName.SENTIMENT_SUBMITTED} | ||
events={[BrowserEvent.onClick]} | ||
section={analyticsSection} | ||
> | ||
<button | ||
onClick={handleClick} | ||
className={cn(`group/${sentiment.toLowerCase()}`, { selected })} | ||
aria-label={`Rate as ${sentiment.toLowerCase()}`} | ||
> | ||
{icon} | ||
</button> | ||
</TraceEvent> | ||
) | ||
} | ||
|
||
export default SentimentButton |
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.