Skip to content

Commit

Permalink
feat(PAYMENTS-18857): add start page
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey-Kornienko-xsolla committed Apr 17, 2024
1 parent 65aa15f commit ce6df80
Show file tree
Hide file tree
Showing 74 changed files with 5,666 additions and 989 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_CDN_URL=https://cdn.xsolla.net/headless-checkout-prod/assets
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_CDN_URL=https://cdn.xsolla.net/headless-checkout-prod/assets
3 changes: 2 additions & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
"target": "react-demo",
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [{ "source": "**", "destination": "/index.html" }]
}
]
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/brand-logo_xsolla.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>%VITE_APP_TITLE%</title>
<title>Headless Checkout</title>
</head>
<body>
<div id="root"></div>
Expand Down
4,163 changes: 3,282 additions & 881 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,29 @@
"**/*": "prettier --write --ignore-unknown"
},
"dependencies": {
"@reduxjs/toolkit": "^2.2.3",
"axios": "^1.6.8",
"install": "^0.13.0",
"npm": "^10.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^6.6.5",
"react-lazy-load-image-component": "^1.6.0",
"react-redux": "^9.1.0",
"react-router-dom": "^6.20.0",
"styled-components": "^5.2.0",
"react-select": "^5.8.0",
"sass": "^1.74.1",
"styled-components": "^6.1.8",
"zod": "^3.22.4"
},
"devDependencies": {
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@rollup/plugin-replace": "^5.0.5",
"@types/axios": "^0.14.0",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/react-lazy-load-image-component": "^1.6.3",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-react": "^4.2.0",
Expand Down
Binary file modified public/brand-logo_xsolla.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 11 additions & 24 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import Layout from './layout.tsx';
import { NoMatch } from './routes/not-found';
import { Home } from './routes/home';
import { LocalizationContextProvider } from './app/contexts/localization-context/localization-context-provider.tsx';
import React from 'react';
import { RouterProvider } from 'react-router-dom';

const router = createBrowserRouter([
{
path: '/',
element: <Layout />,
children: [
{
index: true,
element: <Home />,
},
{
path: '*',
element: <NoMatch />,
},
],
},
]);
import { router } from './routes';
import { Provider } from 'react-redux';
import { store } from './redux/store.ts';
import { LocalizationContextProvider } from './app/contexts/localization-context/localization-context-provider.tsx';

export default function App() {
return (
<LocalizationContextProvider>
<RouterProvider router={router} />
</LocalizationContextProvider>
<Provider store={store}>
<LocalizationContextProvider>
<RouterProvider router={router} />
</LocalizationContextProvider>
</Provider>
);
}
6 changes: 6 additions & 0 deletions src/api/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import axios from 'axios';

const tokenUrl = 'https://us-central1-headless-checkout-app.cloudfunctions.net/generateToken';
export const tokenApiClient = axios.create({
baseURL: tokenUrl,
});
13 changes: 13 additions & 0 deletions src/api/token/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { tokenApiClient } from '../client';

export const getToken = async (parameters: { sandbox: boolean }): Promise<string> => {
const { sandbox } = parameters;
const response = await tokenApiClient.get('', {
params: { ...(sandbox ? { sandbox: '1' } : {}) },
});
if (response.data.error) {
throw new Error(response.data.error.message);
}

return response.data.result;
};
3 changes: 3 additions & 0 deletions src/assets/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/coin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/fonts/SharpGroteskBold20.woff2
Binary file not shown.
Binary file added src/assets/fonts/SharpGroteskBook20.woff
Binary file not shown.
Binary file not shown.
Binary file added src/assets/fonts/SharpGroteskSmBold15.woff
Binary file not shown.
Binary file added src/assets/fonts/SharpGroteskSmBold20.woff2
Binary file not shown.
Binary file added src/assets/headless-checkout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/location--line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/assets/react.svg

This file was deleted.

Loading

0 comments on commit ce6df80

Please sign in to comment.