refactor messageItem component

This commit is contained in:
riqo 2020-10-25 15:13:06 -05:00
commit 9272dfb179
8 changed files with 212 additions and 221 deletions

View file

@ -0,0 +1,40 @@
import { computed } from "vue";
// takes in message modifier as param
export default function useMessageItemComp(m: string) {
const textFill = computed(() => {
switch (m) {
case "fr":
return "#000";
default:
return "#fff";
}
});
const bubbleFill = computed(() => {
switch (m) {
case "sf":
return "#61b4f4";
case "ai":
return "#585858";
default:
return "#fff";
}
});
const startingOffset = computed(() => {
switch (m) {
case "sf":
return "translate(10, 600)";
case "ai":
return "translate(135, 600)";
default:
return "translate(20, 600)";
}
});
return {
textFill,
bubbleFill,
startingOffset
};
}