Skip to content

Commit

Permalink
Update version handling and dev bar styling.
Browse files Browse the repository at this point in the history
  • Loading branch information
brysonjbest committed Nov 28, 2024
1 parent 3e2146f commit 4adc2c2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
6 changes: 5 additions & 1 deletion app/components/RuleManager/RuleManager.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
width: calc(100vw - 15px);
height: 103%;
background: transparent;
background-color: var(--version-color);
background: linear-gradient(
to bottom,
var(--version-color) 0%,
transparent 170%
);
z-index: -1;
opacity: 0.1;
}
Expand Down
5 changes: 4 additions & 1 deletion app/components/VersionBar/VersionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ interface VersionBarProps {
version?: string;
}

export default function VersionBar({ ruleInfo, version = RULE_VERSION.inProduction }: VersionBarProps) {
export default function VersionBar({
ruleInfo,
version = process.env.NEXT_PUBLIC_IN_PRODUCTION ? RULE_VERSION.inProduction : RULE_VERSION.inDev,
}: VersionBarProps) {
const versionColor = getVersionColor(version);

const getButtonStyle = (buttonVersion: RULE_VERSION) => {
Expand Down
8 changes: 5 additions & 3 deletions app/rule/[ruleId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ export async function generateMetadata({ params, searchParams }: Props): Promise
}

export default async function Rule({ params: { ruleId }, searchParams }: Props) {
// Get version of rule to use
const { version = process.env.NEXT_PUBLIC_IN_PRODUCTION ? RULE_VERSION.inProduction : RULE_VERSION.inDev } =
searchParams;
const version = searchParams.version?.trim()
? searchParams.version
: process.env.NEXT_PUBLIC_IN_PRODUCTION
? RULE_VERSION.inProduction
: RULE_VERSION.inDev;

const oAuthRequired = version === RULE_VERSION.draft; // only require oauth if editing a draft
// Ensure user is first logged into github so they can save what they edit
Expand Down
6 changes: 4 additions & 2 deletions app/styles/layout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
}

.alertBanner {
width: 100%;
position: relative;
left: 0;
right: 0;
background: purple;
margin: -8px 0 8px -8px;
width: calc(100% + 16px);
width: calc(100% + 8px);
border-radius: 0;
padding: 4px;
color: white;
Expand Down

0 comments on commit 4adc2c2

Please sign in to comment.