Skip to content

feat: OpenCraft sandbox footer. #6

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

Open
wants to merge 1 commit into
base: sandbox-footer
Choose a base branch
from
Open
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
24 changes: 0 additions & 24 deletions .env.development

This file was deleted.

70 changes: 70 additions & 0 deletions env.config.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// eslint-disable-next-line no-unused-vars",

import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

const OpenCraftFooter = () => (
<>
<footer className="opencraft-footer py-5 px-5">
<div className={'d-flex pb-3 flex-column flex-md-row'}>
<div className={"text-center"}>
<img alt="OpenCraft Logo" className="opencraft-logo pt-1" src="https://opencraft.com/wp-content/uploads/opencraft-logo.png"/>
</div>
<div className={"pr-5 d-none d-md-block"}></div>
<div className={"pt-3 d-block d-md-none"}></div>
<div className={"align-self-top text-center text-md-left"}>
Hosted by <a href="https://opencraft.com/">OpenCraft.</a><br />
A verified Open edX&reg; partner.
</div>
</div>
<hr />
<div className={"text-center text-md-left"}><small>&copy; OpenCraft 2025 | edX and Open edX&reg; are trademarks of edX Inc</small></div>
</footer>
</>
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in separate component file and imported here.


const config = {
ACCESS_TOKEN_COOKIE_NAME: 'edx-jwt-cookie-header-payload',
ACCOUNT_PROFILE_URL: "http://local.openedx.io:1995",
ACCOUNT_SETTINGS_URL: "http://local.openedx.io:1997",
BASE_URL: "local.openedx.io:8080",
CREDENTIALS_BASE_URL: "http://local.openedx.io:18150",
CSRF_TOKEN_API_PATH: "/csrf/api/v1/token",
ECOMMERCE_BASE_URL: "http://local.openedx.io:18130",
LANGUAGE_PREFERENCE_COOKIE_NAME: "openedx-language-preference",
LMS_BASE_URL: "http://local.openedx.io:8000",
STUDIO_BASE_URL: "http://studio.local.openedx.io:8001",
LOGIN_URL: "http://local.openedx.io:8000/login",
LOGOUT_URL: "http://local.openedx.io:8000/logout",
MARKETING_SITE_BASE_URL: "http://local.openedx.io:8000",
ORDER_HISTORY_URL: "localhost:1996/orders",
REFRESH_ACCESS_TOKEN_ENDPOINT: "http://local.openedx.io:8000/login_refresh",
SEGMENT_KEY: "null",
SITE_NAME: "Open edX",
USER_INFO_COOKIE_NAME: "edx-user-info",
LOGO_URL: "/brand-openedx/logo.svg",
LOGO_TRADEMARK_URL: "/brand-openedx/logo-trademark.svg",
LOGO_WHITE_URL: "/brand-openedx/logo-white.svg",
FAVICON_URL: "https://edx-cdn.org/v3/default/favicon.ico",
pluginSlots: {
'org.openedx.frontend.layout.footer.v1': {
plugins: [
{
// Hide the default footer
op: PLUGIN_OPERATIONS.Hide,
widgetId: 'default_contents',
},
{
// Insert a custom footer
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'custom_footer',
type: DIRECT_PLUGIN,
RenderWidget: OpenCraftFooter,
},
},
]
}
},
};

export default config;
4 changes: 2 additions & 2 deletions example/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { initialize, getConfig, subscribe, APP_READY } from '@edx/frontend-platform';
import { AppContext, AppProvider } from '@edx/frontend-platform/react';
import Footer from '@edx/frontend-component-footer';

import './index.scss';
import FooterSlot from '../src/plugin-slots/FooterSlot';

subscribe(APP_READY, () => {
ReactDOM.render(
Expand All @@ -15,7 +15,7 @@ subscribe(APP_READY, () => {
authenticatedUser: null,
config: getConfig(),
}}>
<Footer
<FooterSlot
onLanguageSelected={() => {}}
supportedLanguages={[
{ label: 'English', value: 'en' },
Expand Down
1 change: 1 addition & 0 deletions public/brand-openedx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was accidentally committed.

Submodule brand-openedx added at 4ad44e
2 changes: 2 additions & 0 deletions src/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ $gray-footer: #fcfcfc !default;
.footer {
background-color: var(--pgn-color-light-100, $gray-footer);
}

@import "./custom";
20 changes: 20 additions & 0 deletions src/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$opencraft-green: #0F1F24 !default;
$footer-text-color: #ffffff !default;
$footer-link-hover-color: #8CAEB5 !default;
$opencraft-footer-link-color: #5EFFC9 !default;
$opencraft-accent: #203D44 !default;

Comment on lines +1 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think colors should be hardcoded here. This should be moved to the theme.

.opencraft-footer {
background-color: $opencraft-green;
color: $footer-text-color;
font-size: 16px;
.opencraft-logo {
height: 60px;
}
hr {
border-color: $opencraft-accent;
}
a {
color: $opencraft-footer-link-color;
}
}
3 changes: 3 additions & 0 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ module.exports = createConfig('webpack-dev', {
'@edx/frontend-component-footer': path.resolve(__dirname, 'src'),
},
},
devServer: {
allowedHosts: 'all',
},
});
Loading