Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove old demo/example pkgs #1345

Merged
merged 8 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion demos/client-example/src/Captcha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ProcaptchaFrictionless } from "@prosopo/procaptcha-frictionless";
import { Procaptcha } from "@prosopo/procaptcha-react";
import type { ProcaptchaToken } from "@prosopo/types";
import config from "./config.js";
import { ProcaptchaPow } from "@prosopo/procaptcha-pow";

type CaptchProps = {
captchaType?: string;
Expand Down Expand Up @@ -45,11 +46,17 @@ export function Captcha(props: CaptchProps) {
callbacks={{ onError, onHuman, onExpired }}
aria-label="Frictionless captcha"
/>
) : props.captchaType === 'pow' ? (
<ProcaptchaPow
config={config}
callbacks={{ onError, onHuman, onExpired }}
aria-label="PoW captcha"
/>
) : (
<Procaptcha
config={config}
callbacks={{ onError, onHuman, onExpired }}
aria-label="Captcha"
aria-label="Image captcha"
/>
)}
</div>
Expand Down
9 changes: 8 additions & 1 deletion demos/client-example/src/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ const linkStyle = {
export default function NavBar() {
const location = useLocation();
const frictionlessLinkStyle = { ...linkStyle };
const powLinkStyle = { ...linkStyle };
const imageCaptchaLinkStyle = { ...linkStyle };

// if the current route is `/frictionless`, the link to `/frictionless` should be styled differently
if (location.pathname === "/frictionless") {
frictionlessLinkStyle.textDecoration = "underline";
}
// if the current route is `/pow`, the link to `/pow` should be styled differently
if (location.pathname === "/pow") {
powLinkStyle.textDecoration = "underline";
}
// if the current route is `/`, the link to `/` should be styled differently
if (location.pathname === "/") {
imageCaptchaLinkStyle.textDecoration = "underline";
Expand All @@ -46,7 +51,9 @@ export default function NavBar() {
<Link to="/" style={imageCaptchaLinkStyle}>
Image Captcha
</Link>

<Link to="/pow" style={powLinkStyle}>
PoW Captcha
</Link>
<Link to="/frictionless" style={frictionlessLinkStyle}>
Frictionless Captcha
</Link>
Expand Down
5 changes: 5 additions & 0 deletions demos/client-example/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import ReactDOM from "react-dom/client";
import { RouterProvider, createBrowserRouter } from "react-router-dom";
import FrictionlessRoot from "./routes/frictionless.js";
import ImageCaptchaRoot from "./routes/root.js";
import PowRoot from "./routes/pow.js";

const router = createBrowserRouter([
{
Expand All @@ -27,6 +28,10 @@ const router = createBrowserRouter([
path: "/frictionless",
element: <FrictionlessRoot />,
},
{
path: "/pow",
element: <PowRoot />,
},
]);

const root = ReactDOM.createRoot(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
// Copyright 2021-2024 Prosopo (UK) Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -11,18 +12,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { CssBaseline } from "@mui/material";
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.js";

const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement,
);
import App from "../App.js";

root.render(
<React.Fragment>
<CssBaseline />
<App />
</React.Fragment>,
);
export default function Root() {
return (
<React.Fragment>
<App captchaType={"pow"} />
</React.Fragment>
);
}
11 changes: 0 additions & 11 deletions demos/client-frictionless-example/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions demos/client-frictionless-example/env.development

This file was deleted.

35 changes: 0 additions & 35 deletions demos/client-frictionless-example/index.html

This file was deleted.

48 changes: 0 additions & 48 deletions demos/client-frictionless-example/package.json

This file was deleted.

47 changes: 0 additions & 47 deletions demos/client-frictionless-example/src/App.tsx

This file was deleted.

42 changes: 0 additions & 42 deletions demos/client-frictionless-example/src/config.ts

This file was deleted.

28 changes: 0 additions & 28 deletions demos/client-frictionless-example/src/index.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions demos/client-frictionless-example/tsconfig.json

This file was deleted.

Loading
Loading