Skip to content

Commit

Permalink
fix: website layout issues and gh issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoSM committed Nov 29, 2023
1 parent 9eb1b14 commit 53e973c
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 143 deletions.
18 changes: 9 additions & 9 deletions apps/app/components/molecules/TaskModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const emit = defineEmits(["next"]);
const taskModalStore = useTaskModalStore();
const submissionsStore = useSubmissionsStore();
const coursesStore = useCoursesStore();
const config = useRuntimeConfig();
const loadingButton = ref(false);
const loading = ref(true);
const toast: { error: Function } | undefined = inject("toast");
const toast: { error: Function; success: Function } | undefined =
inject("toast");
const uploadedFile: Ref<File | null> = ref(null);
watch(taskModalStore, async (newValue) => {
Expand All @@ -20,6 +20,10 @@ watch(taskModalStore, async (newValue) => {
}
});
const taskNotSent = computed(
() => submissionsStore.submission?.SubmissionStatus === "Draft"
);
async function loadSubmission() {
loading.value = true;
try {
Expand Down Expand Up @@ -70,7 +74,7 @@ async function sendSubmission(status: "Pending" | "Draft") {
submissionsStore.submission.Filename = response.fileName;
await submissionsStore.updateSubmission();
}
coursesStore.updateCourseLessons(currentLesson._id);
toast?.success("Tarefa enviada com sucesso!");
goToNextLesson();
} finally {
loadingButton.value = false;
Expand Down Expand Up @@ -146,11 +150,7 @@ async function uploadFile(file: File) {
submissionsStore.submission?.SubmissionStatus || 'Pending'
)
"
:status="
submissionsStore.submission?.SubmissionStatus === 'Draft'
? 'warning'
: 'success'
"
:status="taskNotSent ? 'warning' : 'success'"
/>
<div class="flex gap-3 items-center">
<MButton
Expand All @@ -160,7 +160,7 @@ async function uploadFile(file: File) {
/>
<MButton
variant="primary"
text="Enviar"
:text="taskNotSent ? 'Enviar' : 'Reenviar'"
type="submit"
:loading="loadingButton"
/>
Expand Down
1 change: 1 addition & 0 deletions apps/app/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,6 @@ export default defineNuxtConfig({
},
tailwindcss: {
cssPath: "@/styles/main.css",
viewer: false,
},
});
7 changes: 6 additions & 1 deletion apps/app/pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ const hasTask = computed(() => {
return ["Content", "Image"].includes(currentLesson?.submissionContent);
});
function redirectToNextLesson() {
async function redirectToNextLesson() {
if (!nextLesson) return;
if (sessionStore.isConnected()) {
await coursesStore.updateCourseLessons(currentLesson._id);
}
router.push(nextLesson._path as RouteLocationRaw);
}
Expand Down
7 changes: 5 additions & 2 deletions apps/www/components/atoms/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ onMounted(() => {

<!-- <AtomsHeaderLink title="Documentação" /> -->

<UPopover :popper="{ placement: 'bottom-end' }">
<UPopover
:popper="{ placement: 'bottom' }"
class="[&>*]:block [&>*]:md:inline-flex"
>
<AtomsHeaderLink title="Comunidade" chevron />

<template #panel>
Expand Down Expand Up @@ -135,7 +138,7 @@ onMounted(() => {
</nuxt-link>
<nuxt-link
class="block"
:to="`${$config.public.appUrl}sign-in?utm_source=landing_page`"
:to="`${$config.public.appUrl}?utm_source=landing_page`"
>
<MButton
icon-right="arrow-right"
Expand Down
20 changes: 12 additions & 8 deletions apps/www/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @ts-expect-error avoid lint error
import eslintPlugin from "vite-plugin-eslint";
import path from "node:path";

export default defineNuxtConfig({
colorMode: {
preference: "light",
},
sourcemap: { server: true, client: false }, // Disable sourcemap errors
runtimeConfig: {
public: {
siteUrl: process.env.NUXT_PUBLIC_SITE_URL || "https://menthor.io/",
Expand All @@ -16,14 +16,21 @@ export default defineNuxtConfig({
nitro: {
preset: "cloudflare_pages_static",
},
imports: {
dirs: ["composables", "../../packages/composables"],
},
// imports: {
// dirs: ["./composables", "../../packages/composables"],
// },
vue: {
propsDestructure: true,
defineModel: true,
},
extends: ["nuxt-umami"],
typescript: {
tsConfig: {
compilerOptions: {
moduleResolution: "bundler",
},
},
},
css: ["@/styles/font.css", "@fortawesome/fontawesome-svg-core/styles.css"],
alias: {
"@": path.resolve(__dirname, "../../packages/assets"),
Expand All @@ -50,10 +57,6 @@ export default defineNuxtConfig({
vite: {
plugins: [eslintPlugin()],
},
delayHydration: {
mode: "mount",
debug: process.env.NODE_ENV === "development",
},
appConfig: {
umami: {
version: 2,
Expand All @@ -62,5 +65,6 @@ export default defineNuxtConfig({
},
tailwindcss: {
cssPath: "@/styles/main.css",
viewer: false,
},
});
3 changes: 1 addition & 2 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@vueuse/nuxt": "^10.3.0",
"eslint-config-custom": "workspace:*",
"humps": "^2.0.1",
"nuxt-umami": "^2.5.2",
"tailwind-config": "workspace:*"
"nuxt-umami": "^2.5.2"
}
}
5 changes: 1 addition & 4 deletions packages/tailwind-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"lint": "eslint ."
},
"dependencies": {
"autoprefixer": "^10.4.14",
"eslint-config-custom": "workspace:*",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.3"
"eslint-config-custom": "workspace:*"
}
}
3 changes: 3 additions & 0 deletions packages/tailwind-config/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ export default <Partial<Config>>{
sm: "2rem",
md: "2.5rem",
lg: "2.5rem",
xl: "2.5rem",
"2xl": "2.5rem",
},
},
screens: {
sm: "640px",
md: "768px",
lg: "1024px",
xl: "1190px",
"2xl": "1190px",
},
},
},
Expand Down
117 changes: 0 additions & 117 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 53e973c

Please sign in to comment.