Skip to content

Commit c285ec2

Browse files
committed
feat: update the tweet content of quotes
1 parent 771bfa0 commit c285ec2

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

src/components/inc/QuoteCard.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
EditIcon,
77
} from "@components/icons";
88
import { tweetHandler } from "@utils";
9-
import { Flex, Text, Box, IconButton } from "@components/base";
9+
import { Flex, Text, IconButton } from "@components/base";
1010
import { Quote } from "@store/slices/QuotesSlice";
1111
import useStore from "@store";
1212
import { shallow } from "zustand/shallow";
@@ -23,7 +23,7 @@ export function QuoteCard(props: QuoteCardProps) {
2323
const { id, text, author } = props.quote;
2424
const [favouriteQuotes, setFavouriteQuotes] = useStore(
2525
(state) => [state.favouriteQuotes, state.setFavouriteQuotes],
26-
shallow
26+
shallow,
2727
);
2828
const tweetText = `I love this quote by ${author}!
2929
${text}”`;
@@ -33,7 +33,7 @@ export function QuoteCard(props: QuoteCardProps) {
3333
function ToggleFavorite(quoteId: string) {
3434
if (isFavorite(quoteId)) {
3535
setFavouriteQuotes(
36-
favouriteQuotes.filter((favQuote) => favQuote.id !== quoteId)
36+
favouriteQuotes.filter((favQuote) => favQuote.id !== quoteId),
3737
);
3838
} else {
3939
setFavouriteQuotes([...favouriteQuotes, props.quote]);
@@ -104,11 +104,7 @@ export function QuoteCard(props: QuoteCardProps) {
104104
<IconButton
105105
size="xs"
106106
as="a"
107-
href={tweetHandler(
108-
tweetText,
109-
["chroma", "inspring", "inspirational"],
110-
"chroma"
111-
)}
107+
href={tweetHandler(tweetText)}
112108
target="_blank"
113109
rel="noreferrer"
114110
>

src/components/inc/widgets/Quotes.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,7 @@ function Quotes() {
120120
size: 10,
121121
},
122122
}}
123-
href={tweetHandler(
124-
tweetText,
125-
["chroma", "inspring", "inspirational"],
126-
"chroma",
127-
)}
123+
href={tweetHandler(tweetText)}
128124
target="_blank"
129125
rel="noreferrer"
130126
>

src/utils/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ export function handleGoals() {
115115
}
116116
}
117117

118-
export function tweetHandler(text: string, hashtags: string[], via: string) {
118+
export function tweetHandler(text: string) {
119+
const hashtags = ["paige_devmotion", "inspring", "inspirational"];
120+
const via = "paige_devmotion";
119121
const baseUrl = "https://twitter.com/intent/tweet";
120122
const url = `${baseUrl}?text=${encodeURI(
121123
text,

0 commit comments

Comments
 (0)