mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-09 11:13:03 +00:00
tabs always enabled
This commit is contained in:
31
src/App.tsx
31
src/App.tsx
@@ -48,7 +48,6 @@ 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 [activeHomeTab, setActiveHomeTab] = useState<HomeTab>("work");
|
||||
@@ -123,7 +122,7 @@ function Home() {
|
||||
if (event.defaultPrevented || event.isComposing) return;
|
||||
if (event.metaKey || event.ctrlKey || event.altKey) return;
|
||||
|
||||
if (isTabsEnabled && event.key === "Tab") {
|
||||
if (event.key === "Tab") {
|
||||
event.preventDefault();
|
||||
setActiveHomeTab((prev) => {
|
||||
const currentIndex = homeTabs.indexOf(prev);
|
||||
@@ -428,7 +427,6 @@ function Home() {
|
||||
Age: <TimeSince date={new Date(2004, 10, 4, 11, 47, 0)} />
|
||||
</div>
|
||||
</div>
|
||||
{isTabsEnabled ? (
|
||||
<Tabs
|
||||
value={activeHomeTab}
|
||||
onValueChange={(value) => setActiveHomeTab(value as HomeTab)}
|
||||
@@ -471,7 +469,7 @@ function Home() {
|
||||
<div key={location.id}>
|
||||
<Button
|
||||
className={cn(
|
||||
"text-sm border cursor-pointer hover:border-accent justify-start",
|
||||
"text-sm border cursor-pointer hover:border-accent justify-start w-full",
|
||||
activeLocationIndex === index &&
|
||||
activeHomeTab === "travel" &&
|
||||
travelFocusLevel === "location" &&
|
||||
@@ -530,7 +528,7 @@ function Home() {
|
||||
<Button
|
||||
disabled
|
||||
className={cn(
|
||||
"flex text-sm border cursor-pointer hover:border-accent items-center justify-start p-0 pl-2 ",
|
||||
"flex text-sm border cursor-pointer hover:border-accent items-center justify-start p-0 pl-2 w-full",
|
||||
)}
|
||||
variant="dummy"
|
||||
size="sm"
|
||||
@@ -549,10 +547,7 @@ function Home() {
|
||||
(photo, photoIndex) => (
|
||||
<Button
|
||||
key={photo}
|
||||
id={getTravelPhotoItemId(
|
||||
location.id,
|
||||
photoIndex,
|
||||
)}
|
||||
id={getTravelPhotoItemId(location.id, photoIndex)}
|
||||
onClick={() => {
|
||||
const path = getTravelPhotoPath(
|
||||
location,
|
||||
@@ -586,12 +581,12 @@ function Home() {
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
"flex-1 max-w-sm border flex items-center h-128 justify-center text-sm gap-4"
|
||||
"flex-1 max-w-lg border flex items-center h-128 justify-center text-sm gap-4"
|
||||
}
|
||||
>
|
||||
{previewPhotoPath ? (
|
||||
<img
|
||||
className={"flex-1 max-w-sm"}
|
||||
className={"flex-1 object-contain max-h-full"}
|
||||
src={previewPhotoPath}
|
||||
alt={"active-photo"}
|
||||
/>
|
||||
@@ -609,20 +604,6 @@ function Home() {
|
||||
</div>
|
||||
</TabsContent>
|
||||
</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={
|
||||
activeProjectIndex !== null && index === activeProjectIndex
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</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