@c-rex/templates 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c-rex/templates",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -89,46 +89,47 @@ export const ArticleWrapper = ({
89
89
  <RenderArticle htmlContent={htmlContent} contentLang={articleLang} />
90
90
 
91
91
  <div className="w-full sm:w-auto justify-between bg-primary text-primary-foreground rounded-full shadow-lg flex sticky bottom-4 p-2 float-right gap-2 transition-all duration-300">
92
+ {enableHighlight && (
93
+
94
+ <>
95
+ <div className="flex items-center">
96
+ <input
97
+ type="text"
98
+ value={query as string || ""}
99
+ ref={inputRef}
100
+ onKeyDown={(e) => {
101
+ if (e.key === "Enter") {
102
+ next();
103
+ }
104
+ }}
105
+
106
+ onChange={(e) => setQuery(e.target.value || null)}
107
+
108
+ placeholder={t("search")}
109
+ className={cn(
110
+ "border border-gray-300 rounded left-12 transition-all duration-300 rounded-full h-9 bg-secondary text-secondary-foreground focus:outline-none focus:ring-2 focus:ring-blue-500",
111
+ open ? "w-48 opacity-100 px-2 mr-2" : "w-0 opacity-0 px-0"
112
+ )}
113
+ />
114
+
115
+ <Button
116
+ variant="ghost" size="icon" rounded="full"
117
+ onClick={() => setOpen(!open)}
118
+ >
119
+ {open ? <X className="w-5 h-5" /> : <Search className="w-5 h-5" />}
120
+ </Button>
121
+
122
+ </div>
123
+
124
+ <Button variant="ghost" size="icon" rounded="full" onClick={prev}>
125
+ <ArrowBigLeft className="h-5 w-5" />
126
+ </Button>
127
+ <Button variant="ghost" size="icon" rounded="full" onClick={next}>
128
+ <ArrowBigRight className="h-5 w-5" />
129
+ </Button>
130
+ </>
131
+ )}
92
132
 
93
- <div className="flex items-center">
94
- <input
95
- type="text"
96
- value={query as string || ""}
97
- ref={inputRef}
98
- onKeyDown={(e) => {
99
- if (e.key === "Enter") {
100
- next();
101
- }
102
- }}
103
-
104
- onChange={(e) => setQuery(e.target.value || null)}
105
-
106
- placeholder={t("search")}
107
- className={cn(
108
- "border border-gray-300 rounded left-12 transition-all duration-300 rounded-full h-9 bg-secondary text-secondary-foreground focus:outline-none focus:ring-2 focus:ring-blue-500",
109
- open ? "w-48 opacity-100 px-2 mr-2" : "w-0 opacity-0 px-0"
110
- )}
111
- />
112
-
113
- <Button
114
- variant="ghost" size="icon" rounded="full"
115
- onClick={() => setOpen(!open)}
116
- >
117
- {open ? <X className="w-5 h-5" /> : <Search className="w-5 h-5" />}
118
- </Button>
119
-
120
- </div>
121
-
122
- <Button variant="ghost" size="icon" rounded="full" onClick={prev}>
123
- <ArrowBigLeft className="h-5 w-5" />
124
- </Button>
125
- <Button variant="ghost" size="icon" rounded="full" onClick={next}>
126
- <ArrowBigRight className="h-5 w-5" />
127
- </Button>
128
-
129
- <Button variant="ghost" size="icon" rounded="full" onClick={rightSidebar.toggleSidebar}>
130
- <StarIcon className="h-5 w-5" />
131
- </Button>
132
133
 
133
134
  <Button variant="ghost" size="icon" rounded="full" onClick={() => toggleHighlight(!enableHighlight)}>
134
135
  {enableHighlight ?
@@ -137,6 +138,10 @@ export const ArticleWrapper = ({
137
138
  }
138
139
  </Button>
139
140
 
141
+ <Button variant="ghost" size="icon" rounded="full" onClick={rightSidebar.toggleSidebar}>
142
+ <StarIcon className="h-5 w-5" />
143
+ </Button>
144
+
140
145
  <Button variant="ghost" size="icon" rounded="full" onClick={rightSidebar.toggleSidebar}>
141
146
  <PanelRight className="h-5 w-5" />
142
147
  </Button>
@@ -59,7 +59,7 @@ export const FilterSidebar: FC<FilterSidebarProps> = ({ tags, totalItemCount, up
59
59
  onClick={() => updateFilterParam(key, item)}
60
60
  >
61
61
  {item.label} ({item.hits}/{item.total})
62
- {item.active && <Check className="ml-2 h-4 w-4" />}
62
+ {item.active && <Check className="ml-2" />}
63
63
  </SidebarMenuSubButton>
64
64
  </SidebarMenuSubItem>
65
65
  ))}
@@ -4,7 +4,7 @@ import { OperatorType, WildCardType } from "@c-rex/types";
4
4
  import { InformationUnitsService } from "@c-rex/services";
5
5
  import { informationUnitsResponse } from "@c-rex/interfaces";
6
6
  import { SearchProvider } from "@c-rex/contexts/search";
7
- import { getConfigs } from "@c-rex/utils/next-cookies";
7
+ import { getServerConfig } from "@c-rex/core";
8
8
 
9
9
  interface HomeProps {
10
10
  searchParams: {
@@ -21,7 +21,7 @@ interface HomeProps {
21
21
 
22
22
  export const HomeLayout = async ({ searchParams }: HomeProps) => {
23
23
  const { search, page, language, wildcard, operator, like, packages, filter } = searchParams;
24
- const config = await getConfigs();
24
+ const config = getServerConfig();
25
25
 
26
26
  let data = {
27
27
  items: [],
package/src/home/page.tsx CHANGED
@@ -3,7 +3,7 @@
3
3
  import React, { FC, useEffect, useMemo, useState } from "react";
4
4
  import { Funnel, Settings2, X } from "lucide-react"
5
5
  import { useTranslations } from 'next-intl'
6
- import { parseAsBoolean, parseAsInteger, parseAsString, ParserBuilder, useQueryStates, Values } from 'nuqs'
6
+ import { parseAsBoolean, parseAsInteger, parseAsString, useQueryStates } from 'nuqs'
7
7
  import { informationUnitsResponse } from "@c-rex/interfaces";
8
8
  import { Button } from "@c-rex/ui/button";
9
9
  import { Badge } from "@c-rex/ui/badge";
@@ -260,7 +260,7 @@ export const HomePage: FC<HomePageProps> = ({ data }) => {
260
260
  <span className="hidden sm:inline">
261
261
  {t("searchSettings")}
262
262
  </span>
263
- <Settings2 className="h-4 w-4" />
263
+ <Settings2 />
264
264
  </Button>
265
265
  )}
266
266
  />