Skip to content

Commit

Permalink
fix: hotfix on vite configuration (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson authored Nov 13, 2023
1 parent 4a73ac0 commit 51eca3d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 35 deletions.
12 changes: 6 additions & 6 deletions apps/career/src/components/joblist/JobCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const JobCard: React.FC<JobCardProps> = ({
<div className="p-4">
<div className="grid h-auto w-full grid-cols-12 items-center gap-x-11 sm:h-36 sm:gap-24">
{/* Logo Section */}
<div className="col-span-12 lg:col-span-2">
<div className="col-span-12 sm:col-span-2">
<div className="mb-md-0 mb-4 text-center">
<img
src={company_logo}
Expand All @@ -38,7 +38,7 @@ const JobCard: React.FC<JobCardProps> = ({
</div>
</div>
{/* Title Section */}
<div className="col-span-12 lg:col-span-3">
<div className="col-span-12 sm:col-span-3">
<div className="mb-md-0 mb-2">
<h2
className={`truncate text-2xl font-bold text-light-text1 dark:text-dark-text1`}
Expand All @@ -56,21 +56,21 @@ const JobCard: React.FC<JobCardProps> = ({
</div>
</div>
{/* Location Section */}
<div className="col-span-12 lg:col-span-3">
<div className="mb-2 lg:flex">
<div className="col-span-12 sm:col-span-3">
<div className="mb-2 sm:flex">
{/* You can add an icon for location next to the text */}
<p className="mb-0 truncate text-light-text1 dark:text-dark-text1">
{location}
</p>
</div>
</div>
{/* Date Posted Section */}
<div className="col-span-12 lg:col-span-2">
<div className="col-span-12 sm:col-span-2">
<div className="mb-0">
<h2 className="text-2xl font-bold">{formattedTime}</h2>
</div>
</div>
<div className="col-span-12 lg:col-span-2">
<div className="col-span-12 sm:col-span-2">
<div className="flex flex-wrap gap-1.5">
<span className=" rounded bg-green-500/20 px-2 py-0.5 font-medium capitalize text-green-500">
{type}
Expand Down
4 changes: 2 additions & 2 deletions apps/career/src/components/joblist/JobCardFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const JobCardFooter: React.FC<JobFooterProps> = ({ jobID, isRegistered }) => {
<div className="bg-gray-100 px-4 py-4 dark:bg-neutral-700">
{isRegistered ? (
<Link to={`/${jobID}`}>
<div className="col-span-12 text-right text-light-text1 dark:text-dark-text1 lg:col-span-6 lg:mt-0">
<div className="col-span-12 text-right text-light-text1 dark:text-dark-text1 sm:col-span-6 sm:mt-0">
<span>Apply</span>
<KeyboardDoubleArrowRightIcon />
</div>
</Link>
) : (
<div className="col-span-12 cursor-not-allowed text-right text-light-text1 dark:text-dark-text1 lg:col-span-6 lg:mt-0">
<div className="col-span-12 cursor-not-allowed text-right text-light-text1 dark:text-dark-text1 sm:col-span-6 sm:mt-0">
<span>Apply</span>
<KeyboardDoubleArrowRightIcon />
</div>
Expand Down
6 changes: 3 additions & 3 deletions apps/career/src/components/joblist/Joblist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const Joblist: React.FC<CareerComponentProps> = ({
return (
<>
{isLoggedIn ? (
<div className="grid grid-cols-12 gap-y-6 lg:gap-10 lg:gap-y-0">
<div className="col-span-12 lg:col-span-9">
<div className="grid grid-cols-12 gap-y-6 sm:gap-10 sm:gap-y-0">
<div className="col-span-12 sm:col-span-9">
<div className={`mt-14 pt-6`}>
{jobData.map((job, index) => (
<JobCard
Expand All @@ -58,7 +58,7 @@ const Joblist: React.FC<CareerComponentProps> = ({
))}
</div>
</div>
<div className="col-span-12 lg:col-span-3">
<div className="col-span-12 sm:col-span-3">
<div className="mt-14 pt-6">
{isRegistered ? (
<PostRegisterProfile
Expand Down
4 changes: 2 additions & 2 deletions apps/career/src/root.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "@app/styles/main.css"
import "@app/styles/common.css"

configAuth()

type Props = {}
const apiConfig = {
API: {
endpoints: [
Expand All @@ -27,7 +27,7 @@ API.configure(apiConfig)

ReactGA.initialize(import.meta.env.VITE_GA_ID, {})

export default function Root(props) {
export default function Root(props: Props) {
return (
<section className="h-screen">
<RecoilRoot>
Expand Down
1 change: 1 addition & 0 deletions apps/career/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"types": ["vite/client"],
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
55 changes: 33 additions & 22 deletions apps/career/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
import react from "@vitejs/plugin-react"
import { defineConfig, loadEnv } from "vite"
import dynamicImport from "vite-plugin-dynamic-import"
const path = require("path")

export default {
root: "./src",
rollupOptions: {
input: "wasedatime-career.ts",
preserveEntrySignatures: true,
},
build: {
outDir: "../dist",
emptyOutDir: true,
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd() + "/src")

return {
root: "./src",
publicDir: "assets",
base: (env.VITE_PUBLIC_BASE_PATH || "http://localhost:8082") + "/",
rollupOptions: {
input: "./src/wasedatime-career.ts",
input: "wasedatime-career.ts",
preserveEntrySignatures: true,
output: {
entryFileNames: "wasedatime-career.js",
},
build: {
outDir: "../dist",
emptyOutDir: true,
cssCodeSplit: false,
manifest: true,
rollupOptions: {
input: "./src/wasedatime-career.ts",
preserveEntrySignatures: true,
output: {
entryFileNames: "[name].js",
assetFileNames: "assets/[name].[ext]",
},
},
},
},
resolve: {
fullySpecified: false,
alias: {
"@app": path.resolve(__dirname, "src/"),
resolve: {
fullySpecified: false,
alias: {
"@app": path.resolve(__dirname, "src/"),
},
modules: ["node_modules"],
},
modules: ["node_modules"],
},
plugins: [react(), dynamicImport()],
envPrefix: ["VITE_", "REACT_APP_"],
}
plugins: [react(), dynamicImport()],
assetsInclude: ["**/*.png", "**/*.jpg", "**/*.svg"],
envPrefix: ["VITE_", "REACT_APP_"],
}
})

0 comments on commit 51eca3d

Please sign in to comment.