Skip to content

Commit

Permalink
Fix chat mobile adaptation (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: Germey <germey@acedata.cloud>
  • Loading branch information
Germey and Germey authored Jun 15, 2024
1 parent 2199a8c commit b082f52
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "make adaptation for mobile",
"packageName": "@acedatacloud/nexior",
"email": "germey@acedata.cloud",
"dependentChangeType": "patch"
}
5 changes: 5 additions & 0 deletions src/components/application/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ export default defineComponent({
.actions {
margin: 0 5px;
display: inline-block;
@media (max-width: 767px) {
display: block;
margin: 5px auto 0 auto;
width: fit-content;
}
.el-button {
border-radius: 20px;
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/chat/InputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ textarea.input:focus {

<style lang="scss" scoped>
.input-box {
width: 800px;
width: 100%;
max-width: 800px;
margin: auto;
position: relative;
border-radius: 20px;
Expand Down
5 changes: 3 additions & 2 deletions src/components/chat/Introduction.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="introduction">
<el-row class="items" justify="center" :gutter="15">
<el-col v-for="(item, itemKey) in items" :key="itemKey" :md="6" :sm="12" :xs="24">
<el-col v-for="(item, itemKey) in items" :key="itemKey" :md="6" :sm="12" :xs="12">
<introduction-item
:content="item.content"
:icon="item.icon"
Expand Down Expand Up @@ -67,7 +67,8 @@ export default defineComponent({
justify-content: center;
.items {
width: 800px;
max-width: 800px;
width: 100%;
margin: auto;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/chat/IntroductionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ export default defineComponent({
.item {
height: 100px;
font-size: 14px;
background-color: var(--el-color-white);
background-color: var(--el-color-color);
color: var(--el-text-color-primary);
border: 1px solid var(--el-border-color-lighter);
padding: 10px 20px;
border-radius: 20px;
margin-bottom: 15px;
&:hover {
background-color: var(--el-bg-color-page);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/chat/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import {
ERROR_CODE_USED_UP,
ROLE_ASSISTANT
} from '@/constants';
// import message from '@/i18n/zh/common/message';
import { ROUTE_CONSOLE_APPLICATION_BUY } from '@/router';
interface IData {
Expand Down Expand Up @@ -171,6 +170,7 @@ export default defineComponent({
.content {
border-radius: 20px;
padding: 8px 15px;
width: 100%;
max-width: 800px;
.image {
max-width: 100%;
Expand Down
4 changes: 4 additions & 0 deletions src/components/chat/SidePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ export default defineComponent({
height: 100%;
border-right: 1px solid var(--el-border-color);
@media (max-width: 767px) {
border-right: none;
}
.conversations {
width: 100%;
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/midjourney/preset/ModelSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineComponent({
image: 'https://cdn.acedata.cloud/2023-10-06-174633.png'
},
{
value: 'niji',
value: 'niji 5',
label: this.$t('midjourney.model.niji'),
image: 'https://cdn.acedata.cloud/2023-10-06-174008.png'
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<el-button round class="menu" @click="drawer = true">
<font-awesome-icon icon="fa-solid fa-bars" class="icon-menu" />
</el-button>
<el-drawer v-model="drawer" :with-header="false" size="340px" class="drawer">
<el-drawer v-model="drawer" :with-header="false" size="290px" class="drawer">
<side-panel />
</el-drawer>
</div>
Expand Down
12 changes: 10 additions & 2 deletions src/pages/chat/Conversation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<template #chat>
<model-selector2 class="selector" />
<application-status
class="status"
:initializing="initializing"
:application="application"
:need-apply="needApply"
Expand Down Expand Up @@ -294,9 +295,10 @@ export default defineComponent({
.dialogue {
flex: 1;
width: 800px;
width: 100%;
max-width: 800px;
margin: 15px auto;
overflow-y: scroll;
overflow-y: auto;
position: relative;
.messages {
padding-top: 30px;
Expand All @@ -308,4 +310,10 @@ export default defineComponent({
.bottom {
width: 100%;
}
@media (max-width: 767px) {
.status {
margin-top: 20px;
}
}
</style>
3 changes: 1 addition & 2 deletions src/store/common/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export default (): IRootState => {
expiration: undefined
},
setting: {
// if PC, set default to true, else false
navigationCollapsed: window.innerWidth < 768
navigationCollapsed: true
},
chatdoc: chatdocState(),
chat: chatState(),
Expand Down

0 comments on commit b082f52

Please sign in to comment.