Skip to content

Commit

Permalink
Merge pull request #11 from brazucas/feat/relative-paths
Browse files Browse the repository at this point in the history
feat: relative paths in all imports
  • Loading branch information
pedropapa authored Oct 8, 2023
2 parents 6b4be36 + 637ce39 commit 638d91f
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/common/oauth/providers/auth0-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OAuthClient } from "../../oauth-client";
import { OAuthClient } from "@/common/oauth-client";

export class Auth0Client extends OAuthClient {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/blog/Articles.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { blog } from '../../constants';
import useFetch from "../../hooks/useFetch";
import { blog } from '@/constants';
import useFetch from "@/hooks/useFetch";

type Articles = {
posts: Post[];
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { useAuthProvider } from "../../hooks/useAuthProvider";
import { useUser } from "../../hooks/useUser";
import { useAuthProvider } from "@/hooks/useAuthProvider";
import { useUser } from "@/hooks/useUser";

const LoginButton = () => {
const { isUserAuthenticated, userInfo } = useUser();
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useUser.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { useAuthToken } from "./useAuthToken";
import { useCookies } from "react-cookie";
import type { OAuthUserInfo } from "../common/types/oauth.types";
import type { OAuthUserInfo } from "@/common/types/oauth.types";

type UserInfo = {
nickname: string;
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import AppFooter from "../components/AppFooter.astro";
import AppHeader from "../components/AppHeader.astro";
import AppFooter from "@/components/AppFooter.astro";
import AppHeader from "@/components/AppHeader.astro";
---


Expand Down
14 changes: 7 additions & 7 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
import Stats from '../components/Stats.astro';
import Features from '../components/Features.astro';
import HeroSection from '../components/HeroSection.astro';
import Layout from '../layouts/Layout.astro';
import Testimonials from '../components/Testimonials.astro';
import CallToAction from '../components/CallToAction.astro';
import Blog from '../components/Blog.astro';
import Stats from '@/components/Stats.astro';
import Features from '@/components/Features.astro';
import HeroSection from '@/components/HeroSection.astro';
import Layout from '@/layouts/Layout.astro';
import Testimonials from '@/components/Testimonials.astro';
import CallToAction from '@/components/CallToAction.astro';
import Blog from '@/components/Blog.astro';
export const prerender = true;
---
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login_callback.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type APIRoute } from "astro";
import { Auth0Client } from "../common/oauth/providers/auth0-client";
import { Auth0Client } from "@/common/oauth/providers/auth0-client";

const oauthClient = new Auth0Client();

Expand Down
2 changes: 1 addition & 1 deletion src/pages/store.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Layout from '../layouts/Layout.astro';
import Layout from '@/layouts/Layout.astro';
---
<Layout title="BRZ Store">
<div class="space-y-40 mb-40">
Expand Down
13 changes: 8 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"baseUrl": ".",
"jsx": "react-jsx",
"jsxImportSource": "react",
"plugins": [
{
"name": "@astrojs/ts-plugin"
},
],
"paths": {
"@/components/*": ["src/components/*"],
"@/hooks/*": ["src/hooks/*"],
"@/layouts/*": ["src/layouts/*"],
"@/*": ["src/*"],
"@/common/*": ["src/common/*"]
}
},
"paths": {
"@components/*": ["src/components/*"],
"@hooks/*": ["src/hooks/*"],
"@layouts/*": ["src/layouts/*"]
}
}

0 comments on commit 638d91f

Please sign in to comment.