Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(frontend): Root layout route #5275

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/__tests__/routes/_oh.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRemixStub } from "@remix-run/testing";
import { screen, waitFor, within } from "@testing-library/react";
import { renderWithProviders } from "test-utils";
import userEvent from "@testing-library/user-event";
import MainApp from "#/routes/_oh";
import MainApp from "#/routes/_oh/route";
import * as CaptureConsent from "#/utils/handle-capture-consent";
import i18n from "#/i18n";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import { useAuth } from "#/context/auth-context";
import { useUserPrefs } from "#/context/user-prefs-context";
import { handleCaptureConsent } from "#/utils/handle-capture-consent";

interface AccountSettingsModalProps {
interface AccountSettingsFormProps {
onClose: () => void;
selectedLanguage: string;
gitHubError: boolean;
analyticsConsent: string | null;
}

function AccountSettingsModal({
export function AccountSettingsForm({
onClose,
selectedLanguage,
gitHubError,
analyticsConsent,
}: AccountSettingsModalProps) {
}: AccountSettingsFormProps) {
const { gitHubToken, setGitHubToken, logout } = useAuth();
const { saveSettings } = useUserPrefs();
const { t } = useTranslation();
Expand Down Expand Up @@ -136,5 +136,3 @@ function AccountSettingsModal({
</ModalBody>
);
}

export default AccountSettingsModal;
268 changes: 0 additions & 268 deletions frontend/src/routes/_oh.tsx

This file was deleted.

13 changes: 13 additions & 0 deletions frontend/src/routes/_oh/buttons/all-hands-logo-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import AllHandsLogo from "#/assets/branding/all-hands-logo.svg?react";

interface AllHandsLogoButtonProps {
onClick: () => void;
}

export function AllHandsLogoButton({ onClick }: AllHandsLogoButtonProps) {
return (
<button type="button" aria-label="All Hands Logo" onClick={onClick}>
<AllHandsLogo width={34} height={23} />
</button>
);
}
15 changes: 15 additions & 0 deletions frontend/src/routes/_oh/buttons/docs-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import DocsIcon from "#/icons/docs.svg?react";

export function DocsButton() {
return (
<a
href="https://docs.all-hands.dev"
aria-label="Documentation"
target="_blank"
rel="noreferrer noopener"
className="w-8 h-8 rounded-full hover:opacity-80 flex items-center justify-center"
>
<DocsIcon width={28} height={28} />
</a>
);
}
18 changes: 18 additions & 0 deletions frontend/src/routes/_oh/buttons/exit-project-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import NewProjectIcon from "#/icons/new-project.svg?react";

interface ExitProjectButtonProps {
onClick: () => void;
}

export function ExitProjectButton({ onClick }: ExitProjectButtonProps) {
return (
<button
data-testid="new-project-button"
type="button"
aria-label="Start new project"
onClick={onClick}
>
<NewProjectIcon width={28} height={28} />
</button>
);
}
18 changes: 18 additions & 0 deletions frontend/src/routes/_oh/buttons/settings-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import CogTooth from "#/assets/cog-tooth";

interface SettingsButtonProps {
onClick: () => void;
}

export function SettingsButton({ onClick }: SettingsButtonProps) {
return (
<button
type="button"
aria-label="Settings"
className="w-8 h-8 rounded-full hover:opacity-80 flex items-center justify-center"
onClick={onClick}
>
<CogTooth />
</button>
);
}
Loading
Loading