Skip to content

Commit

Permalink
Migrate FtSettingsSection and FtSettingsMenu to the composition API
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Dec 7, 2024
1 parent 6e2ec28 commit aff090f
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script setup>
import { onMounted, ref } from 'vue'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtPrompt from '../ft-prompt/ft-prompt.vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
{{ $t('Settings.Settings') }}
</h2>
<a
v-for="(settingsSection) in settingsSections"
v-for="settingsSection in settingsSections"
:id="settingsSection.type"
:key="settingsSection.type + '-link'"
:key="settingsSection.type"
class="title"
href="javascript:;"
@click.stop="goToSettingsSection(settingsSection.type)"
@keydown.enter.stop="goToSettingsSection(settingsSection.type)"
>
<div class="titleContent">
<div class="iconAndTitleText">
<font-awesome-icon
<FontAwesomeIcon
:icon="['fas', settingsSection.icon]"
class="titleIcon"
/>
Expand All @@ -28,5 +28,24 @@
</menu>
</template>

<script src="./ft-settings-menu.js" />
<style scoped src="./ft-settings-menu.css" />
<script setup>
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
defineProps({
settingsSections: {
type: Array,
required: true
}
})
const emit = defineEmits(['navigate-to-section'])
/**
* @param {string} sectionType
*/
function goToSettingsSection(sectionType) {
emit('navigate-to-section', sectionType)
}
</script>

<style scoped src="./FtSettingsMenu.css" />
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,13 @@
</div>
</template>

<script src="./ft-settings-section.js" />
<style scoped src="./ft-settings-section.scss" lang="scss" />
<script setup>
defineProps({
title: {
type: String,
required: true
}
})
</script>

<style scoped src="./FtSettingsSection.scss" lang="scss" />
2 changes: 1 addition & 1 deletion src/renderer/components/ParentalControlSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<script setup>
import { computed } from 'vue'
import FtSettingsSection from './ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from './FtSettingsSection/FtSettingsSection.vue'
import FtToggleSwitch from './ft-toggle-switch/ft-toggle-switch.vue'
import store from '../store/index'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<script setup>
import { computed, ref } from 'vue'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtInput from '../ft-input/ft-input.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtButton from '../ft-button/ft-button.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/ThemeSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
import { computed, ref } from 'vue'
import { useI18n } from '../composables/use-i18n-polyfill'
import FtSettingsSection from './ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from './FtSettingsSection/FtSettingsSection.vue'
import FtSelect from './ft-select/ft-select.vue'
import FtToggleSwitch from './ft-toggle-switch/ft-toggle-switch.vue'
import FtSlider from './ft-slider/ft-slider.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/data-settings/data-settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent } from 'vue'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import { mapActions, mapMutations } from 'vuex'
import FtButton from '../ft-button/ft-button.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtInputTags from '../../components/ft-input-tags/ft-input-tags.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent } from 'vue'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtSelect from '../ft-select/ft-select.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtSelect from '../ft-select/ft-select.vue'
import FtInput from '../ft-input/ft-input.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
Expand Down
17 changes: 0 additions & 17 deletions src/renderer/components/ft-settings-menu/ft-settings-menu.js

This file was deleted.

11 changes: 0 additions & 11 deletions src/renderer/components/ft-settings-section/ft-settings-section.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions, mapMutations } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtSelect from '../ft-select/ft-select.vue'
import FtInput from '../ft-input/ft-input.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/player-settings/player-settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtSelect from '../ft-select/ft-select.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtSlider from '../ft-slider/ft-slider.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtButton from '../ft-button/ft-button.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/proxy-settings/proxy-settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtButton from '../ft-button/ft-button.vue'
import FtSelect from '../ft-select/ft-select.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtInput from '../ft-input/ft-input.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent } from 'vue'
import { mapActions } from 'vuex'
import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue'
import FtSettingsSection from '../FtSettingsSection/FtSettingsSection.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'

export default defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/views/Settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ExperimentalSettings from '../../components/ExperimentalSettings/Experime
import PasswordSettings from '../../components/PasswordSettings/PasswordSettings.vue'
import PasswordDialog from '../../components/PasswordDialog/PasswordDialog.vue'
import FtToggleSwitch from '../../components/ft-toggle-switch/ft-toggle-switch.vue'
import FtSettingsMenu from '../../components/ft-settings-menu/ft-settings-menu.vue'
import FtSettingsMenu from '../../components/FtSettingsMenu/FtSettingsMenu.vue'

const ACTIVE_CLASS_NAME = 'active'
const SETTINGS_MOBILE_WIDTH_THRESHOLD = 1015
Expand Down

0 comments on commit aff090f

Please sign in to comment.