Merge version_1 into main
Merge version_1 into main
This commit was merged in pull request #2.
This commit is contained in:
@@ -143,7 +143,6 @@ export default function RestaurantPage() {
|
||||
]}
|
||||
textboxLayout="default"
|
||||
useInvertedBackground={false}
|
||||
animationType="slide-up"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -153,10 +152,10 @@ export default function RestaurantPage() {
|
||||
description="Pročitajte realne ocene i iskustva od naših zadovoljnih gostiju"
|
||||
testimonials={[
|
||||
{
|
||||
id: "1", name: "Marko Jovanović", handle: "@markojovan", testimonial: "Odličan restoran sa autentičnom srpskom kuhinjom! Ćevapi su fantastični i služba je odlična.", imageSrc: "http://img.b2bpic.net/free-photo/portrait-sexy-handsome-fashion-businessman-model-dressed-elegant-blue-suit-posing-street-background-metrosexual_158538-10540.jpg?_wi=1", imageAlt: "Marko Jovanović"
|
||||
id: "1", name: "Marko Jovanović", handle: "@markojovan", testimonial: "Odličan restoran sa autentičnom srpskom kuhinjom! Ćevapi su fantastični i služba je odlična.", imageSrc: "http://img.b2bpic.net/free-photo/portrait-sexy-handsome-fashion-businessman-model-dressed-elegant-blue-suit-posing-street-background-metrosexual_158538-10540.jpg", imageAlt: "Marko Jovanović"
|
||||
},
|
||||
{
|
||||
id: "2", name: "Jelena Nikolić", handle: "@jelena_nik", testimonial: "Najbolja Karađorđeva šnicla koju sam ikada probala. Šef kuvar je ustvari velik sa taštima.", imageSrc: "http://img.b2bpic.net/free-photo/blond-business-woman-blue-shirt_23-2148095792.jpg?_wi=1", imageAlt: "Jelena Nikolić"
|
||||
id: "2", name: "Jelena Nikolić", handle: "@jelena_nik", testimonial: "Najbolja Karađorđeva šnicla koju sam ikada probala. Šef kuvar je ustvari velik sa taštima.", imageSrc: "http://img.b2bpic.net/free-photo/blond-business-woman-blue-shirt_23-2148095792.jpg", imageAlt: "Jelena Nikolić"
|
||||
},
|
||||
{
|
||||
id: "3", name: "Aleksandar Đorđević", handle: "@aleksandar_d", testimonial: "Atmosfera je nedostižna, hrana je svežа i ukusna. Preporučujem svakome ko dolazi u Niš!", imageSrc: "http://img.b2bpic.net/free-photo/elegance-style-masculinity-concept-attractive-trendy-looking-young-brunette-man-with-bristle-happy-smile-expressing-confidence-posing-isolated-yellow-wall-turning-head-round_343059-4597.jpg", imageAlt: "Aleksandar Đorđević"
|
||||
@@ -165,10 +164,10 @@ export default function RestaurantPage() {
|
||||
id: "4", name: "Kristina Pavlović", handle: "@kristina_pav", testimonial: "Čorba je greška moga neizvršena - prijatna, topla i pravi recept od bake! Bravo!", imageSrc: "http://img.b2bpic.net/free-photo/young-lady-posing-while-standing-blouse-denim-jacket-looking-pretty-front-view_176474-109186.jpg", imageAlt: "Kristina Pavlović"
|
||||
},
|
||||
{
|
||||
id: "5", name: "Dragan Stanković", handle: "@dragan_s", testimonial: "Resotran sa pravi duš srpske tradicije. Bledska krempita je savršena završnica.", imageSrc: "http://img.b2bpic.net/free-photo/portrait-sexy-handsome-fashion-businessman-model-dressed-elegant-blue-suit-posing-street-background-metrosexual_158538-10540.jpg?_wi=2", imageAlt: "Dragan Stanković"
|
||||
id: "5", name: "Dragan Stanković", handle: "@dragan_s", testimonial: "Resotran sa pravi duš srpske tradicije. Bledska krempita je savršena završnica.", imageSrc: "http://img.b2bpic.net/free-photo/portrait-sexy-handsome-fashion-businessman-model-dressed-elegant-blue-suit-posing-street-background-metrosexual_158538-10540.jpg", imageAlt: "Dragan Stanković"
|
||||
},
|
||||
{
|
||||
id: "6", name: "Milica Ilić", handle: "@milica_i", testimonial: "Osvežavajuće iskustvo obeda sa porodicom. Decu je sve veoma svidelo i brzo snimile sliku!", imageSrc: "http://img.b2bpic.net/free-photo/blond-business-woman-blue-shirt_23-2148095792.jpg?_wi=2", imageAlt: "Milica Ilić"
|
||||
id: "6", name: "Milica Ilić", handle: "@milica_i", testimonial: "Osvežavajuće iskustvo obeda sa porodicom. Decu je sve veoma svidelo i brzo snimile sliku!", imageSrc: "http://img.b2bpic.net/free-photo/blond-business-woman-blue-shirt_23-2148095792.jpg", imageAlt: "Milica Ilić"
|
||||
}
|
||||
]}
|
||||
textboxLayout="default"
|
||||
|
||||
@@ -1,51 +1,53 @@
|
||||
"use client";
|
||||
|
||||
import { memo } from "react";
|
||||
import useSvgTextLogo from "./useSvgTextLogo";
|
||||
import { cls } from "@/lib/utils";
|
||||
import React, { useMemo } from "react";
|
||||
|
||||
interface SvgTextLogoProps {
|
||||
logoText: string;
|
||||
adjustHeightFactor?: number;
|
||||
verticalAlign?: "top" | "center";
|
||||
text: string;
|
||||
className?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
fontSize?: number;
|
||||
fontWeight?: string | number;
|
||||
fill?: string;
|
||||
strokeWidth?: number;
|
||||
stroke?: string;
|
||||
dominantBaseline?: "hanging" | "middle" | "central" | "text-bottom" | "alphabetic" | "baseline";
|
||||
}
|
||||
|
||||
const SvgTextLogo = memo<SvgTextLogoProps>(function SvgTextLogo({
|
||||
logoText,
|
||||
adjustHeightFactor,
|
||||
verticalAlign = "top",
|
||||
className = "",
|
||||
}) {
|
||||
const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor);
|
||||
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
||||
text,
|
||||
className,
|
||||
width = 200,
|
||||
height = 100,
|
||||
fontSize = 32,
|
||||
fontWeight = "bold", fill = "currentColor", strokeWidth = 0,
|
||||
stroke = "none", dominantBaseline = "middle"}) => {
|
||||
const textWidth = useMemo(() => {
|
||||
return text.length * (fontSize * 0.6);
|
||||
}, [text, fontSize]);
|
||||
|
||||
return (
|
||||
<svg
|
||||
ref={svgRef}
|
||||
viewBox={viewBox}
|
||||
className={cls("w-full", className)}
|
||||
style={{ aspectRatio: aspectRatio }}
|
||||
preserveAspectRatio="none"
|
||||
role="img"
|
||||
aria-label={`${logoText} logo`}
|
||||
viewBox={`0 0 ${Math.max(width, textWidth)} ${height}`}
|
||||
className={className}
|
||||
width={width}
|
||||
height={height}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<text
|
||||
ref={textRef}
|
||||
x="0"
|
||||
y={verticalAlign === "center" ? "50%" : "0"}
|
||||
className="font-bold fill-current"
|
||||
style={{
|
||||
fontSize: "20px",
|
||||
letterSpacing: "-0.02em",
|
||||
dominantBaseline: verticalAlign === "center" ? "middle" : "text-before-edge"
|
||||
}}
|
||||
x={Math.max(width, textWidth) / 2}
|
||||
y={height / 2}
|
||||
textAnchor="middle"
|
||||
dominantBaseline={dominantBaseline}
|
||||
fontSize={fontSize}
|
||||
fontWeight={fontWeight}
|
||||
fill={fill}
|
||||
strokeWidth={strokeWidth}
|
||||
stroke={stroke}
|
||||
>
|
||||
{logoText}
|
||||
{text}
|
||||
</text>
|
||||
</svg>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
SvgTextLogo.displayName = "SvgTextLogo";
|
||||
|
||||
export default SvgTextLogo;
|
||||
export default SvgTextLogo;
|
||||
Reference in New Issue
Block a user