mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-07 18:23:04 +00:00
VITE_TABS env variable needed for tabs
This commit is contained in:
21
src/App.tsx
21
src/App.tsx
@@ -43,6 +43,7 @@ export default App;
|
||||
|
||||
function Home() {
|
||||
const isDevMode = import.meta.env.VITE_PUBLIC_DEV === "1";
|
||||
const isTabsEnabled = import.meta.env.VITE_TABS === "1";
|
||||
const navigate = useNavigate();
|
||||
const [asciiArt, setAsciiArt] = useState("");
|
||||
const [activeTab, setActiveTab] = useState<HomeTab>("work");
|
||||
@@ -87,7 +88,7 @@ function Home() {
|
||||
if (event.defaultPrevented || event.isComposing) return;
|
||||
if (event.metaKey || event.ctrlKey || event.altKey) return;
|
||||
|
||||
if (event.key === "Tab") {
|
||||
if (isTabsEnabled && event.key === "Tab") {
|
||||
event.preventDefault();
|
||||
setActiveTab((prev) => {
|
||||
const currentIndex = homeTabs.indexOf(prev);
|
||||
@@ -197,6 +198,7 @@ function Home() {
|
||||
Age: <TimeSince date={new Date(2004, 10, 4, 11, 47, 0)} />
|
||||
</div>
|
||||
</div>
|
||||
{isTabsEnabled ? (
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
onValueChange={(value) => setActiveTab(value as HomeTab)}
|
||||
@@ -216,7 +218,7 @@ function Home() {
|
||||
Travel
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
<div className="-mt-[1.5px] p-2 border">
|
||||
<div className="-mt-[1.5px] border p-2">
|
||||
<TabsContent value={homeTabs[0]}>
|
||||
<div className="grid grid-cols-1 gap-2 md:grid-cols-2">
|
||||
{visibleProjects.map((project, index) => (
|
||||
@@ -230,9 +232,22 @@ function Home() {
|
||||
))}
|
||||
</div>
|
||||
</TabsContent>
|
||||
<TabsContent value={homeTabs[1]}>test </TabsContent>
|
||||
<TabsContent value={homeTabs[1]} />
|
||||
</div>
|
||||
</Tabs>
|
||||
) : (
|
||||
<div className="w-full max-w-5xl grid grid-cols-1 gap-2 md:grid-cols-2">
|
||||
{visibleProjects.map((project, index) => (
|
||||
<ProjectListItem
|
||||
key={project.metadata.slug}
|
||||
metadata={project.metadata}
|
||||
isDevMode={isDevMode}
|
||||
isActive={activeIndex !== null && index === activeIndex}
|
||||
enableHover={hasPointerInteraction}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div className="w-full max-w-5xl grid grid-cols-1 md:grid-cols-[1fr_auto_1fr] items-center gap-3 md:gap-4">
|
||||
<div className="flex items-center gap-6">
|
||||
<AskAI name="me" inline />
|
||||
|
||||
Reference in New Issue
Block a user