Skip to content

Commit

Permalink
uses compiled vue3-pinboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Nov 7, 2024
1 parent d8e1514 commit 14f5fd9
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 77 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dist
dist-ssr
coverage
*.local
.env.development

/cypress/videos/
/cypress/screenshots/
Expand Down
36 changes: 32 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@fortawesome/pro-regular-svg-icons": "^6.6.0",
"@phila/phila-ui-core": "^1.0.15",
"@phila/pinboard": "2.0.15",
"@phila/pinboard": "2.0.50",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-router": "^0.10.8"
},
Expand Down
10 changes: 10 additions & 0 deletions src/assets/mac-style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0,0,0,.5);
box-shadow: 0 0 1px rgba(255,255,255,.5);
}
25 changes: 7 additions & 18 deletions src/components/ExpandCollapseContent.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script setup>
import { useMainStore } from '@phila/pinboard/src/stores/MainStore.js';
import { useConfigStore } from '@phila/pinboard/src/stores/ConfigStore.js';
import { ref, computed, getCurrentInstance, onBeforeMount, onMounted, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
// import { useRoute, useRouter } from 'vue-router';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { getPickupDetails, parseTimeRange, parseException } = useLocalSharedFunctions();
Expand All @@ -21,12 +19,7 @@ import GeneralSiteCard from './GeneralSiteCard.vue';
import FridgeSiteCard from './FridgeSiteCard.vue';
import PublicBenefitsSiteCard from './PublicBenefitsSiteCard.vue';
// import PrintShareSection from '../../node_modules/@phila/pinboard/src/components/PrintShareSection';
import PrintShareSection from '@phila/pinboard/src/components/PrintShareSection.vue';
const MainStore = useMainStore();
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const props = defineProps({
item: {
Expand All @@ -37,9 +30,9 @@ const props = defineProps({
}
});
const isMobile = computed(() => {
return MainStore.isMobileDevice;
});
// const isMobile = computed(() => {
// return MainStore.isMobileDevice;
// });
const currentUnixDate = computed (() => {
let currentYear = format(new Date(), 'yyyy');
Expand Down Expand Up @@ -237,11 +230,8 @@ const makeValidUrl = (url) => {

<template>
<div>
<div :class="isMobile ? 'main-content-mobile' : 'main-content'">
<print-share-section
:item="item"
/>

<!-- <div :class="isMobile ? 'main-content-mobile' : 'main-content'"> -->
<div>
<div class="columns">
<div class="column is-6">
<div
Expand Down Expand Up @@ -444,7 +434,6 @@ const makeValidUrl = (url) => {
</template>

<style lang="scss" scoped>
// @import "../../node_modules/@phila/pinboard/src/assets/scss/expandCollapse.scss";
.location-content {
// font-size: 14px;
Expand Down
10 changes: 4 additions & 6 deletions src/components/FridgeSiteCard.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script setup>
import { computed } from 'vue';
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const props = defineProps({
item: {
Expand All @@ -15,15 +13,15 @@ const props = defineProps({
});
const subsections = computed(() => {
return this.$config.subsections;
return $config.subsections;
});
const section = computed(() => {
return this.subsections[this.$props.item.properties['category']];
return subsections[props.item.properties['category']];
});
const subsection = computed(() => {
return this.$props.item.properties.category;
return props.item.properties.category;
});
</script>
Expand Down
4 changes: 1 addition & 3 deletions src/components/GeneralSiteCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
Expand Down
4 changes: 1 addition & 3 deletions src/components/NdsSchoolCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
Expand Down
4 changes: 1 addition & 3 deletions src/components/PhaSchoolCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const props = defineProps({
item: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/PlaystreetsSchoolCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const props = defineProps({
item: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/PprSchoolCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const props = defineProps({
item: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/PublicBenefitsSiteCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
import useLocalSharedFunctions from '../composables/useLocalSharedFunctions.js';
const { parseException } = useLocalSharedFunctions();
Expand Down
4 changes: 1 addition & 3 deletions src/components/SeniorMealSiteCard.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script setup>
import { computed } from 'vue';
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const props = defineProps({
item: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/SeniorMealSitePprCard.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const props = defineProps({
item: {
Expand Down
15 changes: 4 additions & 11 deletions src/components/customGreeting.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
<script setup>
import { useMainStore } from '../../node_modules/@phila/pinboard/src/stores/MainStore.js';
import { useMapStore } from '../../node_modules/@phila/pinboard/src/stores/MapStore.js';
import { useGeocodeStore } from '../../node_modules/@phila/pinboard/src/stores/GeocodeStore.js';
import { useDataStore } from '../../node_modules/@phila/pinboard/src/stores/DataStore.js';
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
import { parse, format } from 'date-fns';
// import { parse, format } from 'date-fns';
import { onMounted, watch, ref, computed, defineEmits } from 'vue';
const MainStore = useMainStore();
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
const $emit = defineEmits(['view-list']);
Expand Down Expand Up @@ -95,7 +88,7 @@ watch(
// let subsections = getCounts();
subsections.value = getCounts();
// $store.commit('setSubsections', subsections);
MainStore.subsections = subsections.value;
// MainStore.subsections = subsections.value;
},
);
Expand Down
4 changes: 1 addition & 3 deletions src/components/greetingSection.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup>
import { useConfigStore } from '../../node_modules/@phila/pinboard/src/stores/ConfigStore.js';
const ConfigStore = useConfigStore();
const $config = ConfigStore.config;
import $config from '../main.js';
import { getCurrentInstance } from 'vue';
const props = defineProps({
Expand Down
26 changes: 16 additions & 10 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
// (we might not need to use axios with new vue async tools)
// if that is not needed, we can move this info to main.js

import isMac from './util/is-mac';
if (isMac()) {
import('./assets/mac-style.scss')
}

// Font Awesome Icons
import { library } from '@fortawesome/fontawesome-svg-core';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
Expand All @@ -15,14 +20,13 @@ import { faTimes as farTimes } from '@fortawesome/pro-regular-svg-icons';
import { faPlus as farPlus } from '@fortawesome/pro-regular-svg-icons';
import { faMinus as farMinus } from '@fortawesome/pro-regular-svg-icons';
import { markRaw } from 'vue';

// library.add(faExclamationTriangle, faHandHoldingHeart);
// library.add(faExclamationTriangle, faHandHoldingHeart, farTimes, farPlus, farMinus);
library.add(faExclamationTriangle, faHandHoldingHeart, farAngleDown, farAngleUp, farTimes, farPlus, farMinus);

// import pinboard
import pinboard from '../node_modules/@phila/pinboard/src/main.js';
if (import.meta.env.VITE_DEBUG) console.log('pinboard:', pinboard);
import pinboard from '@phila/pinboard';
// import pinboard from '../node_modules/@phila/pinboard/src/main.js';
if (import.meta.env.VITE_DEBUG) console.log('test pinboard:', pinboard);

import '../node_modules/@phila/pinboard/dist/style.css';

// import greeting from './general/greeting';
import legendControls from './general/legendControls';
Expand All @@ -47,9 +51,7 @@ const customComps = markRaw({
import i18n from './i18n/i18n';
// if (import.meta.env.VITE_DEBUG) console.log('main.js i18n:', i18n);

// pinboard();
pinboard({
// export default {
let $config = {
i18n: i18n.i18n,
publicPath: import.meta.env.VITE_PUBLICPATH,
app: {
Expand Down Expand Up @@ -658,4 +660,8 @@ pinboard({
'circle-stroke-color': 'white',
},
},
});
};

pinboard($config);
export default $config;

3 changes: 3 additions & 0 deletions src/util/is-mac.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function () {
return /Macintosh/.test(navigator.userAgent);
}

0 comments on commit 14f5fd9

Please sign in to comment.