Skip to content

Commit 1eea08c

Browse files
Add updates to twitter-editor
1 parent 3a70326 commit 1eea08c

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

apps/web/app/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "./page.module.css";
55
import QuizMarkdownEditor from "../components/markdown-editor";
66
import ChatgptEditor from "../components/chatgpt-editor";
77
import TwitterEditor from "../components/twitter-editor";
8+
89
import GradientEditor from "../components/gradient-editor";
910
import { CardSizeProvider } from "@repo/ui/context/CardSizeContext";
1011

@@ -24,7 +25,8 @@ const tabs = [
2425
{
2526
key: "twitter",
2627
label: "Twitter Card",
27-
}
28+
},
29+
2830
];
2931

3032
export default function Home() {
@@ -37,6 +39,7 @@ export default function Home() {
3739
{tab === "chatgpt" ? <ChatgptEditor /> : null}
3840
{/* {tab === "gradient" ? <GradientEditor /> : null} */}
3941
{tab === "twitter" ? <TwitterEditor /> : null}
42+
4043
</CardSizeProvider>
4144
</MainHomeLayout>
4245
);

apps/web/components/twitter-editor.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,16 @@ export default function TwitterEditor() {
9494
isRtl: false,
9595
name: "John",
9696
username: "john_doe",
97-
text: "Elon Musk accused Apple of antitrust violations, claiming that the iPhone maker is favoring OpenAI's ChatGPT while sidelining his AI product Grok and the X app. Musk argues this contravenes fair competition, as both Grok and X struggle to rank high in the App Store despite recent upgrades.",
97+
text: "Boost your workflow with PostMaker.dev! Create, schedule, and share posts seamlessly across all your platforms. Say goodbye to cluttered posting and hello to smarter content management. Start creating now!",
9898
showTwitterUI: true,
9999
verified: true,
100100
profileImage: "",
101101
tweetImage: "",
102102
});
103103

104104
const {
105-
previewHeightPixels,
106-
previewWidthPixels,
107-
width: Width,
108-
height: Height,
105+
width: width,
106+
height: height,
109107
innerPaddingX,
110108
innerPaddingY,
111109
pageName,
@@ -224,14 +222,14 @@ export default function TwitterEditor() {
224222
/>
225223
<button
226224
onClick={() => profileImageInputRef.current?.click()}
227-
className="px-4 py-2 bg-gray-200 rounded-md hover:bg-gray-300"
225+
className="px-2 py-2 bg-blue-500 rounded-md hover:bg-blue-700"
228226
>
229227
Upload Profile Image
230228
</button>
231229
{profileImage && (
232230
<button
233231
onClick={() => setStateValue('profileImage', '')}
234-
className="ml-2 px-4 py-2 bg-red-200 rounded-md hover:bg-red-300"
232+
className="ml-2 px-4 py-2 bg-red-400 rounded-md hover:bg-red-500"
235233
>
236234
Remove
237235
</button>
@@ -242,14 +240,14 @@ export default function TwitterEditor() {
242240

243241
<div className="flex flex-col mt-4 border p-2 rounded-md">
244242
<label className="block mb-2">
245-
Preview Width: {Width ? Width : 0}px
243+
Preview Width: {width ? width : 0}px
246244
</label>
247245
<input
248246
type="range"
249247
min="40"
250248
name="previewWidth"
251249
max="1920"
252-
value={Width}
250+
value={width}
253251
onChange={(e) =>
254252
setStateValue(e.target.name, Number(e.target.value))
255253
}
@@ -258,14 +256,14 @@ export default function TwitterEditor() {
258256
</div>
259257
<div className="flex flex-col mt-4 border p-2 rounded-md">
260258
<label className="block mb-2">
261-
Preview Height: {Height ? Height : 0}px
259+
Preview Height: {height ? height : 0}px
262260
</label>
263261
<input
264262
type="range"
265263
min="40"
266264
name="previewHeight"
267265
max="1920"
268-
value={Height}
266+
value={height}
269267
onChange={(e) =>
270268
setStateValue(e.target.name, Number(e.target.value))
271269
}
@@ -397,8 +395,8 @@ export default function TwitterEditor() {
397395
style={{
398396
zIndex: 10,
399397
backgroundColor: "transparent",
400-
width: `${Width}px`,
401-
height: `${Height}px`,
398+
width: `${width}px`,
399+
height: `${height}px`,
402400
overflow: "clip",
403401
}}
404402
className="transition-all duration-200 select-none preview-container-drag"

0 commit comments

Comments
 (0)