From e970aa7a26fecfa38041bb1cfa59a1d5f40a0194 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 23 Aug 2024 15:06:37 -0700 Subject: initial groundwork for interactivity via mdx --- src/components/AnotherComponent.tsx | 28 +++++++++++++++++ src/components/FFXIVWorldSelector.tsx | 59 +++++++++++++++++++++++++++++++++++ src/content/blog/ffxiv-gil-making.mdx | 19 +++++++++++ src/styles/ffxiv-gil-making.css | 0 4 files changed, 106 insertions(+) create mode 100644 src/components/AnotherComponent.tsx create mode 100644 src/components/FFXIVWorldSelector.tsx create mode 100644 src/content/blog/ffxiv-gil-making.mdx create mode 100644 src/styles/ffxiv-gil-making.css (limited to 'src') diff --git a/src/components/AnotherComponent.tsx b/src/components/AnotherComponent.tsx new file mode 100644 index 0000000..f74e924 --- /dev/null +++ b/src/components/AnotherComponent.tsx @@ -0,0 +1,28 @@ +import React, { useState, useEffect } from 'react'; + +const AnotherComponent: React.FC = () => { + const [selectedWorld, setSelectedWorld] = useState(null); + + useEffect(() => { + // Load selected world from localStorage + const savedWorld = localStorage.getItem('selectedWorld'); + if (savedWorld) { + setSelectedWorld(savedWorld); + } + }, []); + + return ( +
+

Selected World: {selectedWorld}

+ +
+ ); +}; + +export default AnotherComponent; \ No newline at end of file diff --git a/src/components/FFXIVWorldSelector.tsx b/src/components/FFXIVWorldSelector.tsx new file mode 100644 index 0000000..f2dc4cc --- /dev/null +++ b/src/components/FFXIVWorldSelector.tsx @@ -0,0 +1,59 @@ +import React, { useState, useEffect } from 'react'; + +interface World { + id: number; + name: string; +} + +const FFXIVWorldSelector: React.FC = () => { + const [worlds, setWorlds] = useState([]); + const [selectedWorld, setSelectedWorld] = useState(null); + + useEffect(() => { + const fetchWorlds = async () => { + try { + const response = await fetch('https://universalis.app/api/v2/worlds'); + const data = await response.json(); + setWorlds(data); + } catch (error) { + console.error('Error fetching worlds:', error); + } + }; + + fetchWorlds(); + + // Load selected world from localStorage + const savedWorld = localStorage.getItem('selectedWorld'); + if (savedWorld) { + setSelectedWorld(savedWorld); + } + }, []); + + const handleWorldChange = (event: React.ChangeEvent) => { + const selectedWorld = event.target.value; + setSelectedWorld(selectedWorld); + localStorage.setItem('selectedWorld', selectedWorld); // Save to localStorage + }; + + const handleApplyClick = () => { + window.location.reload(); // Refresh the page + }; + + return ( +
+ + + {selectedWorld &&

Selected World: {selectedWorld}

} + +
+ ); +}; + +export default FFXIVWorldSelector; \ No newline at end of file diff --git a/src/content/blog/ffxiv-gil-making.mdx b/src/content/blog/ffxiv-gil-making.mdx new file mode 100644 index 0000000..002ab8c --- /dev/null +++ b/src/content/blog/ffxiv-gil-making.mdx @@ -0,0 +1,19 @@ +--- +title: "FFXIV - Actually Making Gil Without Crafting" +description: "An actually OK guide at how to become a gillionaire without crafting (not just running roulettes and maps)" +pubDate: "2024-08-23" +--- +import '../../styles/ffxiv-gil-making.css' +import FFXIVWorldSelector from '../../components/FFXIVWorldSelector'; +import AnotherComponent from '../../components/AnotherComponent'; + +*Enter the world you play on below to get crowdsourced marketboard prices* + + + + +I've seen a lot of these "making gil without crafting" or "making gil with combat job" guides during my time with the game. +A lot of these videos and guides are fine, but in my opinion they neglect a lot of the late game and niche options that are available to players. + +This post will attempt to be a somewhat comprehensive guide to making gil without having to level any crafting jobs (cause I get it, crafting is not for everyone). + \ No newline at end of file diff --git a/src/styles/ffxiv-gil-making.css b/src/styles/ffxiv-gil-making.css new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3