Skip to content

Commit

Permalink
web/satellite: VLoader, VModal, VList migrated to use composition api
Browse files Browse the repository at this point in the history
VLIst component and tests deleted;
related tests moved to ignore folder;

Change-Id: Id65754a044cdc8adcd551a6f4e3c5df65b11ffa0
  • Loading branch information
NikolaiYurchenko authored and Storj Robot committed Dec 15, 2022
1 parent e54d9b1 commit 55774ba
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 480 deletions.
51 changes: 0 additions & 51 deletions web/satellite/src/components/common/VList.vue

This file was deleted.

36 changes: 14 additions & 22 deletions web/satellite/src/components/common/VLoader.vue
Expand Up @@ -7,32 +7,24 @@
</div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
<script setup lang="ts">
import { computed } from 'vue';
import LoaderImage from '@/../static/images/common/loader.svg';
// @vue/component
@Component({
components: {
LoaderImage,
},
})
export default class VLoader extends Vue {
@Prop({ default: 'unset' })
private readonly width: string;
@Prop({ default: 'unset' })
private readonly height: string;
@Prop({ default: false })
private readonly isWhite: boolean;
const props = withDefaults(defineProps<{
width?: string;
height?: string;
isWhite?: boolean;
}>(), {
width: 'unset',
height: 'unset',
isWhite: () => false,
});
/**
* Returns loader's width and height from props.
*/
public get style(): Record<string, unknown> {
return { width: this.width, height: this.height };
}
}
const style = computed((): Record<string, unknown> => {
return { width: props.width, height: props.height };
});
</script>

<style scoped lang="scss">
Expand Down
31 changes: 9 additions & 22 deletions web/satellite/src/components/common/VModal.vue
Expand Up @@ -14,33 +14,20 @@
</div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
<script setup lang="ts">
import { onMounted, ref } from 'vue';
import CloseCrossIcon from '@/../static/images/common/closeCross.svg';
// @vue/component
@Component({
components: {
CloseCrossIcon,
},
})
export default class VModal extends Vue {
@Prop({ default: () => () => {} })
public readonly onClose: () => void;
const props = withDefaults(defineProps<{
onClose?: () => void;
}>(), { onClose: () => () => {} });
public $refs!: {
modal: HTMLDivElement,
};
const modal = ref<HTMLElement>();
/**
* Mounted hook after initial render.
* Focus on root div to make modal closable by ESCAPE click.
*/
public mounted(): void {
this.$refs.modal.focus();
}
}
onMounted((): void => {
modal.value?.focus();
});
</script>

<style scoped lang="scss">
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 55774ba

Please sign in to comment.