A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: Optimize the mobile style of QueryGroup component
shuaia26aae634854
diff --git a/ui/src/components/QueryGroup/index.scss b/ui/src/components/QueryGroup/index.scssnew file mode 100644index 00000000..9ab5b36d--- /dev/null+++ b/ui/src/components/QueryGroup/index.scss@@ -0,0 +1,16 @@+.md-show {+ display: flex !important;+}+.md-hide {+ display: none;+}+++@media screen and (max-width: 768px) {+ .md-show {+ display: none !important;+ }+ .md-hide {+ display: block;+ }+}diff --git a/ui/src/components/QueryGroup/index.tsx b/ui/src/components/QueryGroup/index.tsxindex 7f6a0f3e..52fca616 100644--- a/ui/src/components/QueryGroup/index.tsx+++ b/ui/src/components/QueryGroup/index.tsx@@ -27,6 +27,8 @@ import classNames from 'classnames';import { REACT_BASE_PATH } from '@/router/alias';import { floppyNavigation } from '@/utils';+import './index.scss';+interface Props {data;i18nKeyPrefix: string;@@ -80,9 +82,7 @@ const Index: FC<Props> = ({return (<>- <ButtonGroup- size="sm"- className={classNames('d-none d-sm-block', wrapClassName)}>+ <ButtonGroup size="sm" className={classNames('md-show', wrapClassName)}>{normalBtnData.map((btn) => {const key = typeof btn === 'string' ? btn : btn.sort;const name = typeof btn === 'string' ? btn : btn.name;@@ -132,8 +132,8 @@ const Index: FC<Props> = ({</ButtonGroup><DropdownButtonsize="sm"- variant="secondary"- className="d-block d-sm-none"+ variant="outline-secondary"+ className="md-hide"title={t(currentSort)}>{data.map((btn) => {const key = typeof btn === 'string' ? btn : btn.sort;