мобильное меню на лендинге, ссылки исправлены + переменные для запросов на сервер
This commit is contained in:
parent
d54244eb50
commit
2881022b2d
@ -9,11 +9,8 @@ import type {
|
||||
RegisterResponse,
|
||||
} from "@frontend/kitui"
|
||||
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/auth"
|
||||
: "https://hub.pena.digital/auth"
|
||||
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/auth"
|
||||
console.log("переменная", apiUrl)
|
||||
export async function register(
|
||||
login: string,
|
||||
password: string,
|
||||
|
@ -3,10 +3,7 @@ import { AxiosError } from "axios"
|
||||
|
||||
import { parseAxiosError } from "@root/utils/parse-error"
|
||||
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/customer"
|
||||
: "https://hub.pena.digital/customer"
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/customer"
|
||||
|
||||
export async function patchCart(
|
||||
tariffId: string
|
||||
|
@ -28,7 +28,7 @@ const regList:Record<string, number> = {
|
||||
export async function getHistory(): Promise<[GetHistoryResponse | null, string?]> {
|
||||
try {
|
||||
const historyResponse = await makeRequest<never, GetHistoryResponse>({
|
||||
url: "https://hub.pena.digital/customer/history?page=1&limit=100&type=payCart",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/customer/history?page=1&limit=100&type=payCart",
|
||||
method: "get",
|
||||
useToken: true,
|
||||
})
|
||||
|
@ -4,7 +4,7 @@ import { parseAxiosError } from "@root/utils/parse-error"
|
||||
|
||||
import type { GetDiscountsResponse } from "@root/model/discount"
|
||||
|
||||
const apiUrl = process.env.NODE_ENV === "production" ? "/price" : "https://hub.pena.digital/price"
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/price"
|
||||
|
||||
export async function getDiscounts(signal: AbortSignal | undefined): Promise<[GetDiscountsResponse | null, string?]> {
|
||||
try {
|
||||
|
@ -4,7 +4,7 @@ import { parseAxiosError } from "@root/utils/parse-error"
|
||||
export async function getRecentlyPurchasedTariffs(): Promise<[any | null, string?]> {
|
||||
try {
|
||||
const recentlyPurchased = await makeRequest<never, any>({
|
||||
url: "https://hub.pena.digital/customer/recent",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/customer/recent",
|
||||
method: "get",
|
||||
useToken: true,
|
||||
})
|
||||
|
@ -5,7 +5,7 @@ import { parseAxiosError } from "@root/utils/parse-error"
|
||||
import type { ServiceKeyToPrivilegesMap } from "@root/model/privilege"
|
||||
import type { GetTariffsResponse } from "@root/model/tariff"
|
||||
|
||||
const apiUrl = process.env.NODE_ENV === "production" ? "/strator" : "https://hub.pena.digital/strator"
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/strator"
|
||||
|
||||
export async function getTariffs(
|
||||
apiPage: number,
|
||||
|
@ -3,10 +3,7 @@ import { parseAxiosError } from "@root/utils/parse-error"
|
||||
|
||||
import { SendTicketMessageRequest } from "@frontend/kitui"
|
||||
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/heruvym"
|
||||
: "https://hub.pena.digital/heruvym"
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/heruvym"
|
||||
|
||||
export async function sendTicketMessage(
|
||||
ticketId: string,
|
||||
|
@ -2,10 +2,7 @@ import { User, makeRequest } from "@frontend/kitui"
|
||||
import { PatchUserRequest } from "@root/model/user"
|
||||
import { parseAxiosError } from "@root/utils/parse-error"
|
||||
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/user"
|
||||
: "https://hub.pena.digital/user"
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/user"
|
||||
|
||||
export async function patchUser(
|
||||
user: PatchUserRequest
|
||||
|
@ -9,10 +9,7 @@ import type {
|
||||
UpdateDocumentsArgs,
|
||||
} from "@root/model/auth"
|
||||
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/verification"
|
||||
: "https://hub.pena.digital/verification"
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/verification"
|
||||
|
||||
export async function verification(
|
||||
userId: string
|
||||
|
@ -2,10 +2,7 @@ import { makeRequest } from "@frontend/kitui"
|
||||
import { SendPaymentRequest, SendPaymentResponse } from "@root/model/wallet"
|
||||
import { parseAxiosError } from "@root/utils/parse-error"
|
||||
|
||||
const apiUrl =
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/customer"
|
||||
: "https://hub.pena.digital/customer"
|
||||
const apiUrl = "https://" + process.env.REACT_APP_DOMAIN + "/customer"
|
||||
|
||||
const testPaymentBody: SendPaymentRequest = {
|
||||
type: "bankCard",
|
||||
|
@ -48,6 +48,7 @@ export const DropDownMenu = ({ anchorElement, setAnchorElement, items = [] }: Dr
|
||||
transition: ".2s",
|
||||
}}
|
||||
to={url}
|
||||
target="_blank"
|
||||
>
|
||||
{name}
|
||||
<span
|
||||
|
@ -62,7 +62,7 @@ export default function Chat({ sx }: Props) {
|
||||
const chatBoxRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useTicketMessages({
|
||||
url: "https://hub.pena.digital/heruvym/getMessages",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/heruvym/getMessages",
|
||||
isUnauth: true,
|
||||
ticketId: sessionData?.ticketId,
|
||||
messagesPerPage,
|
||||
@ -81,7 +81,7 @@ export default function Chat({ sx }: Props) {
|
||||
|
||||
useSSESubscription<TicketMessage>({
|
||||
enabled: Boolean(sessionData),
|
||||
url: `https://hub.pena.digital/heruvym/ticket?ticket=${sessionData?.ticketId}&s=${sessionData?.sessionId}`,
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + `/heruvym/ticket?ticket=${sessionData?.ticketId}&s=${sessionData?.sessionId}`,
|
||||
onNewData: addOrUpdateUnauthMessages,
|
||||
onDisconnect: useCallback(() => {
|
||||
setUnauthIsPreventAutoscroll(false)
|
||||
@ -131,7 +131,7 @@ export default function Chat({ sx }: Props) {
|
||||
if (!sessionData) {
|
||||
setIsMessageSending(true)
|
||||
createTicket({
|
||||
url: "https://hub.pena.digital/heruvym/create",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/heruvym/create",
|
||||
body: {
|
||||
Title: "Unauth title",
|
||||
Message: messageField,
|
||||
|
@ -57,10 +57,10 @@ export default function Footer() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Link to="https://shab.pena.digital/docs/oferta">
|
||||
<Link to="https://hub.pena.digital/docs/oferta" target="_blank">
|
||||
<Button variant="pena-navitem-dark">Оферта</Button>
|
||||
</Link>
|
||||
<Link to="https://shab.pena.digital/docs/privacy">
|
||||
<Link to="https://hub.pena.digital/docs/privacy" target="_blank">
|
||||
<Button variant="pena-navitem-dark">Политика конфиденциальности</Button>
|
||||
</Link>
|
||||
{/* <Button variant="pena-navitem-dark">Меню 1</Button>
|
||||
|
@ -25,7 +25,7 @@ export default function Menu() {
|
||||
{
|
||||
name: "Наши продукты",
|
||||
url: "/faq",
|
||||
subMenu: [{ name: "PenaQuiz", url: "https://squiz.pena.digital" }],
|
||||
subMenu: [{ name: "PenaQuiz", url: "https://quiz.pena.digital" }],
|
||||
},
|
||||
{
|
||||
name: "Наши услуги",
|
||||
@ -100,6 +100,7 @@ export default function Menu() {
|
||||
alignItems: "center",
|
||||
}}
|
||||
to={url}
|
||||
target="_blank"
|
||||
onMouseEnter={() => setActiveSubMenu(subMenu)}
|
||||
state={{ previousUrl: location.pathname }}
|
||||
>
|
||||
|
@ -64,6 +64,7 @@ export default function DialogMenu({ open, handleClose }: DialogMenuProps) {
|
||||
const cash = useUserStore((state) => state.userAccount?.wallet.cash) ?? 0;
|
||||
|
||||
const [subMenuOpen, setSubMenuOpen] = useState(false);
|
||||
const [subMenuProdOpen, setSubMenuProdOpen] = useState(false)
|
||||
|
||||
const isMobileHeight = useMediaQuery("(max-height: 400px)");
|
||||
|
||||
@ -104,7 +105,7 @@ export default function DialogMenu({ open, handleClose }: DialogMenuProps) {
|
||||
<Button
|
||||
component={Link}
|
||||
to="/faq"
|
||||
onClick={handleClose}
|
||||
onClick={() => setSubMenuProdOpen(!subMenuProdOpen)}
|
||||
state={user ? undefined : { backgroundLocation: location }}
|
||||
disableRipple
|
||||
variant="text"
|
||||
@ -124,6 +125,43 @@ export default function DialogMenu({ open, handleClose }: DialogMenuProps) {
|
||||
>
|
||||
Наши продукты
|
||||
</Button>
|
||||
<Box
|
||||
sx={{
|
||||
ml: "20px",
|
||||
display: "flex",
|
||||
alignItems: isTablet ? "flex-start" : "flex-end",
|
||||
flexDirection: "column",
|
||||
}}
|
||||
>
|
||||
{subMenuProdOpen ?
|
||||
<Button
|
||||
component={Link}
|
||||
to={"https://quiz.pena.digital/"}
|
||||
state={user ? undefined : {backgroundLocation: location}}
|
||||
disableRipple
|
||||
variant="text"
|
||||
target="_blank"
|
||||
sx={{
|
||||
fontWeight: "500",
|
||||
// color: location.pathname === url ? theme.palette.purple.main : location.pathname === "/" ? "white" : "black",
|
||||
|
||||
color: "white",
|
||||
height: "fit-content",
|
||||
textTransform: "none",
|
||||
marginBottom: "19px",
|
||||
fontSize: "16px",
|
||||
"&:hover": {
|
||||
background: "none",
|
||||
color: theme.palette.purple.main,
|
||||
},
|
||||
}}
|
||||
>
|
||||
PenaQuiz
|
||||
</Button>
|
||||
: null
|
||||
}
|
||||
</Box>
|
||||
|
||||
<Button
|
||||
onClick={() => setSubMenuOpen(!subMenuOpen)}
|
||||
disableRipple
|
||||
@ -148,7 +186,7 @@ export default function DialogMenu({ open, handleClose }: DialogMenuProps) {
|
||||
sx={{
|
||||
ml: "20px",
|
||||
display: "flex",
|
||||
alignItems: "flex-start",
|
||||
alignItems: isTablet ? "flex-start" : "flex-end",
|
||||
flexDirection: "column",
|
||||
}}
|
||||
>
|
||||
@ -160,11 +198,12 @@ export default function DialogMenu({ open, handleClose }: DialogMenuProps) {
|
||||
to={url}
|
||||
state={user ? undefined : { backgroundLocation: location }}
|
||||
disableRipple
|
||||
target="_blank"
|
||||
variant="text"
|
||||
sx={{
|
||||
fontWeight: "500",
|
||||
// color: location.pathname === url ? theme.palette.purple.main : location.pathname === "/" ? "white" : "black",
|
||||
|
||||
textAlign: isTablet ? "start" : "end",
|
||||
color: "white",
|
||||
height: "fit-content",
|
||||
textTransform: "none",
|
||||
@ -190,7 +229,7 @@ export default function DialogMenu({ open, handleClose }: DialogMenuProps) {
|
||||
to={user ? "/tariffs" : "/signin"}
|
||||
state={user ? undefined : { backgroundLocation: location }}
|
||||
variant="pena-contained-dark"
|
||||
sx={{ px: "30px", ml: "40px", width: "245px", mt: subMenuOpen ? "50px" : "0" }}
|
||||
sx={{ px: "30px", ml: "40px", width: "245px", mt: "50px" }}
|
||||
>
|
||||
Регистрация / Войти
|
||||
</Button>
|
||||
|
@ -25,7 +25,7 @@ export default function ProtectedLayout() {
|
||||
const ticketsPerPage = useTicketStore((state) => state.ticketsPerPage)
|
||||
|
||||
useSSESubscription<Ticket>({
|
||||
url: `https://hub.pena.digital/heruvym/subscribe?Authorization=${token}`,
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + `/heruvym/subscribe?Authorization=${token}`,
|
||||
onNewData: (data) => {
|
||||
updateTickets(data.filter((d) => Boolean(d.id)))
|
||||
setTicketCount(data.length)
|
||||
@ -34,7 +34,7 @@ export default function ProtectedLayout() {
|
||||
})
|
||||
|
||||
useTicketsFetcher({
|
||||
url: "https://hub.pena.digital/heruvym/getTickets",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/heruvym/getTickets",
|
||||
ticketsPerPage,
|
||||
ticketApiPage,
|
||||
onSuccess: (result) => {
|
||||
|
@ -30,7 +30,7 @@ export default () => (
|
||||
Настоящая политика обработки персональных данных составлена в соответствии с требованиями Федерального
|
||||
закона от 27.07.2006. № 152-ФЗ «О персональных данных» (далее — Закон о персональных данных) и определяет
|
||||
порядок обработки персональных данных и меры по обеспечению безопасности персональных данных,
|
||||
предпринимаемые ООО "Пена") (далее — Оператор).
|
||||
предпринимаемые ООО "ПЕНА") (далее — Оператор).
|
||||
</Typography>
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
@ -41,7 +41,7 @@ export default () => (
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
1.2. Настоящая политика Оператора в отношении обработки персональных данных (далее — Политика) применяется
|
||||
ко всей информации, которую Оператор может получить о посетителях веб-сайта https://quiz.pena.digital.
|
||||
ко всей информации, которую Оператор может получить о посетителях веб-сайта https://pena.digital.
|
||||
</Typography>
|
||||
<Typography></Typography>
|
||||
<Typography variant="h6" sx={{ textAlign: "center" }}>
|
||||
@ -60,7 +60,7 @@ export default () => (
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
2.3. Веб-сайт — совокупность графических и информационных материалов, а также программ для ЭВМ и баз данных,
|
||||
обеспечивающих их доступность в сети интернет по сетевому адресу https://quiz.pena.digital.
|
||||
обеспечивающих их доступность в сети интернет по сетевому адресу https://pena.digital.
|
||||
</Typography>
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
@ -91,7 +91,7 @@ export default () => (
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
2.8. Персональные данные — любая информация, относящаяся прямо или косвенно к определенному или определяемому
|
||||
Пользователю веб-сайта https://quiz.pena.digital.
|
||||
Пользователю веб-сайта https://pena.digital.
|
||||
</Typography>
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
@ -102,7 +102,7 @@ export default () => (
|
||||
</Typography>
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
2.10. Пользователь — любой посетитель веб-сайта https://quiz.pena.digital.
|
||||
2.10. Пользователь — любой посетитель веб-сайта https://pena.digital.
|
||||
</Typography>
|
||||
<Typography></Typography>
|
||||
<Typography>
|
||||
|
@ -39,7 +39,7 @@ const App = () => {
|
||||
const navigate = useNavigate()
|
||||
|
||||
useUserFetcher({
|
||||
url: `https://hub.pena.digital/user/${userId}`,
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + `/user/${userId}`,
|
||||
userId,
|
||||
onNewUser: setUser,
|
||||
onError: (error) => {
|
||||
@ -53,7 +53,7 @@ const App = () => {
|
||||
})
|
||||
|
||||
useUserAccountFetcher({
|
||||
url: "https://hub.pena.digital/customer/account",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/customer/account",
|
||||
userId,
|
||||
onNewUserAccount: setUserAccount,
|
||||
onError: (error) => {
|
||||
|
@ -40,7 +40,7 @@ export default function History() {
|
||||
try {
|
||||
await makeRequest (
|
||||
{
|
||||
url: `https://hub.pena.digital/customer/sendReport/${tariffId}`,
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + `/customer/sendReport/${tariffId}`,
|
||||
method: "POST",
|
||||
}
|
||||
)
|
||||
|
@ -17,7 +17,7 @@ export default function CreateTicket() {
|
||||
if (!ticketBodyField || !ticketNameField) return
|
||||
|
||||
createTicket({
|
||||
url: "https://hub.pena.digital/heruvym/create",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/heruvym/create",
|
||||
body: {
|
||||
Title: ticketNameField,
|
||||
Message: ticketBodyField,
|
||||
|
@ -58,7 +58,7 @@ function SupportChat() {
|
||||
const fetchState = useMessageStore((state) => state.ticketMessageFetchState)
|
||||
|
||||
useTicketMessages({
|
||||
url: "https://hub.pena.digital/heruvym/getMessages",
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + "/heruvym/getMessages",
|
||||
ticketId,
|
||||
messagesPerPage,
|
||||
messageApiPage,
|
||||
@ -76,7 +76,7 @@ function SupportChat() {
|
||||
|
||||
useSSESubscription<TicketMessage>({
|
||||
enabled: Boolean(token) && Boolean(ticketId),
|
||||
url: `https://hub.pena.digital/heruvym/ticket?ticket=${ticketId}&Authorization=${token}`,
|
||||
url: "https://" + process.env.REACT_APP_DOMAIN + `/heruvym/ticket?ticket=${ticketId}&Authorization=${token}`,
|
||||
onNewData: addOrUpdateMessages,
|
||||
onDisconnect: useCallback(() => {
|
||||
clearMessageState()
|
||||
|
Loading…
Reference in New Issue
Block a user